desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
task custom_routes: :environment do
  require 'rails/application/route_inspector'

  inspector = Rails::Application::RouteInspector.new
  puts    inspector.format(Rails.application.routes.routes)

  #all_routes = Rails.application.routes.routes

  #inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
  #puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, ENV['CONTROLLER'])
end