class OperationsController < ApplicationController respond_to :json def create app = App.find_by_app_key!(params[:app_key]) #aqui retorna um 404 operation = app.new_operation(params[:operation]) operation.save respond_with operation end end