Skip to content

Instantly share code, notes, and snippets.

@searls
Created December 3, 2015 14:10
Show Gist options
  • Save searls/fee16a6ff4614c7b7e78 to your computer and use it in GitHub Desktop.
Save searls/fee16a6ff4614c7b7e78 to your computer and use it in GitHub Desktop.
debugging an activeadmin controller method
> Admin::EstimatesController.instance_method(:update).source
" def update(options={}, &block)
object = resource
if update_resource(object, resource_params)
options[:location] ||= smart_resource_url
end
respond_with_dual_blocks(object, options, &block)
end"
ActiveAdmin.register Estimate do
controller do
def update(options={}, &block)
object = resource
if update_resource(object, resource_params)
options[:location] ||= smart_resource_url
else
binding.pry #<-- yay!
end
respond_with_dual_blocks(object, options, &block)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment