aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks/routes.rake
blob: 7dc54144da8693458803ad713b1f2fe7f870b015 (plain) (blame)
1
2
3
4
5
6
7
8
9
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
task :routes => :environment do
  Rails.application.reload_routes!
  all_routes = Rails.application.routes.routes

  require 'rails/application/route_inspector'
  inspector = Rails::Application::RouteInspector.new
  puts inspector.format(all_routes, ENV['CONTROLLER']).join "\n"
end