Class: Closeio::Rails::WebhooksController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Closeio::Rails::WebhooksController
- Defined in:
- app/controllers/closeio/rails/webhooks_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
def closeio
if params[:model] == 'lead'
SyncUsersJob.perform_later params[:data][:id]
end
head :ok
end
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/closeio/rails/webhooks_controller.rb', line 13 def create request.format = :json ActiveSupport::Notifications.instrument("closeio.#{params[:action]}", params) #must return an ok - check Rails version to determine whether to return nothing or head response. if ::Rails.version =~ /^4/ render nothing: true else head :ok end end |
#debug ⇒ Object
25 26 27 |
# File 'app/controllers/closeio/rails/webhooks_controller.rb', line 25 def debug render json: {response: "It works - this is the debug method in Closeio::Rails::WebhooksController"} end |