Created
July 29, 2012 21:23
-
-
Save r38y/3201907 to your computer and use it in GitHub Desktop.
Override resources to include a delete action
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
module DeleteResourceRoute | |
def resources(*args, &block) | |
super(*args) do | |
yield if block_given? | |
member do | |
get :delete | |
delete :delete, action: :destroy | |
end | |
end | |
end | |
end | |
ActionDispatch::Routing::Mapper.send(:include, DeleteResourceRoute) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment