Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Custom actions #6

Open
kerinin opened this issue Feb 7, 2010 · 1 comment
Open

Feature Request: Custom actions #6

kerinin opened this issue Feb 7, 2010 · 1 comment

Comments

@kerinin
Copy link

kerinin commented Feb 7, 2010

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.

@TylerRick
Copy link

I was wanting this feature too today. +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants