aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/tasks/routes.rake
blob: 1815c2fdc701afdc21da8a0b24c0978592894a1f (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(all_routes)
  puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, ENV['CONTROLLER'])
end