Class: Houdini::PostbacksController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/houdini/postbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
11
# File 'app/controllers/houdini/postbacks_controller.rb', line 3

def create
  object_class = params[:object_class].classify.constantize
  object = object_class.find(params[:object_id])
  if object.process_postback(params[:task_name], HashWithIndifferentAccess.new(request.request_parameters))
    render :json => {:success => true}
  else
    render :json => {:success => false}, :status => 422
  end
end