aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/tasks/routes.rake
blob: 95f47566efe926c23994270528fa50af3436e25a (plain) (tree)
1
2
3
4
5
6
7
                                                                                                             
                               
                                              
                                             
                                                          
                                                                
   
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
task :routes => :environment do
  all_routes = Rails.application.routes.routes
  require 'action_dispatch/routing/inspector'
  inspector = ActionDispatch::Routing::RoutesInspector.new
  puts inspector.format(all_routes, ENV['CONTROLLER']).join "\n"
end