Skip to content

Instantly share code, notes, and snippets.

@ltw
Created January 24, 2012 22:16
Show Gist options
  • Save ltw/1673064 to your computer and use it in GitHub Desktop.
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
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