Created
January 24, 2012 22:16
-
-
Save ltw/1673064 to your computer and use it in GitHub Desktop.
List all routes available in a Rails application with the mappings back to controllers and actions
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
namespace :routes do | |
desc 'print list of routes' | |
task :list => [:environment] do | |
Rails.application.routes.routes.map do |route| | |
p "#{route.requirements[:controller]} #{route.requirements[:action]} #{route.verb}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment