resource_controller
resource_controller copied to clipboard
Feature Request: Custom actions
It would be really nice to be able to use the all the r_c hooks with custom actions. For instance, I'd like to be able to add an action to the 'actions' list, define the skeleton action, then be able to define .before, .response, etc for the action:
actions :all, :custom
def custom
build_object
load_object
before :custom
if object.save
after :custom
set_flash :custom
response_for :custom
else
after :custom_fails
set_flash :custom_fails
response_for :custom_fails
end
end
custom.before do
something_cool
end
Maybe this is possible and I was getting errors for some other reason, but AFAICT this doesn't allow you to define customizations.
I was wanting this feature too today. +1