-
-
Save altamic/381397 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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