resource_controller icon indicating copy to clipboard operation
resource_controller copied to clipboard

Feature Request: Custom actions

Open kerinin opened this issue 16 years ago • 1 comments

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.

kerinin avatar Feb 07 '10 19:02 kerinin

I was wanting this feature too today. +1

TylerRick avatar Sep 30 '10 22:09 TylerRick