2011-11-25 06:54:39 -05:00
|
|
|
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
|
2007-06-28 14:33:06 -04:00
|
|
|
task :routes => :environment do
|
2010-07-01 11:07:48 -04:00
|
|
|
Rails.application.reload_routes!
|
2010-08-28 21:53:18 -04:00
|
|
|
all_routes = Rails.application.routes.routes
|
2010-08-15 15:35:59 -04:00
|
|
|
|
2011-09-09 21:50:32 -04:00
|
|
|
require 'rails/application/route_inspector'
|
|
|
|
inspector = Rails::Application::RouteInspector.new
|
|
|
|
puts inspector.format(all_routes, ENV['CONTROLLER']).join "\n"
|
2010-08-29 13:28:10 -04:00
|
|
|
end
|