Skip to content

Instantly share code, notes, and snippets.

@altamic
Forked from alexspeller/gist:359031
Created April 27, 2010 21:54
Show Gist options
  • Save altamic/381397 to your computer and use it in GitHub Desktop.
Save altamic/381397 to your computer and use it in GitHub Desktop.
# Implements the "missing action" route by default
# see http://thelucid.com/2010/03/15/rails-can-we-please-have-a-delete-action-by-default/
ActionController::Resources::Resource.class_eval do
def add_default_actions_with_delete_action
add_default_actions_without_delete_action
add_default_action(member_methods, :get, :delete)
end
alias_method_chain :add_default_actions, :delete_action
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment