Created
December 3, 2015 14:10
-
-
Save searls/fee16a6ff4614c7b7e78 to your computer and use it in GitHub Desktop.
debugging an activeadmin controller method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> 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" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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