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.'
|
2012-10-14 06:03:39 -04:00
|
|
|
task routes: :environment do
|
2010-08-28 21:53:18 -04:00
|
|
|
all_routes = Rails.application.routes.routes
|
2012-07-01 23:00:10 -04:00
|
|
|
require 'action_dispatch/routing/inspector'
|
2012-12-30 09:04:09 -05:00
|
|
|
inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
|
|
|
|
puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, ENV['CONTROLLER'])
|
2010-08-29 13:28:10 -04:00
|
|
|
end
|