Skip to content

Instantly share code, notes, and snippets.

@alexspeller
Created April 7, 2010 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexspeller/359031 to your computer and use it in GitHub Desktop.
Save alexspeller/359031 to your computer and use it in GitHub Desktop.
config/initializers/delete_action.rb
# 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