Skip to content

Instantly share code, notes, and snippets.

@r38y
Created July 29, 2012 21:23
Show Gist options
  • Save r38y/3201907 to your computer and use it in GitHub Desktop.
Save r38y/3201907 to your computer and use it in GitHub Desktop.
Override resources to include a delete action
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