We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2dc1402 commit 6cabc9aCopy full SHA for 6cabc9a
railties/lib/rails/tasks/routes.rake
@@ -3,6 +3,9 @@ task :routes => :environment do
3
Rails::Application.reload_routes!
4
all_routes = ENV['CONTROLLER'] ? Rails.application.routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : Rails.application.routes.routes
5
routes = all_routes.collect do |route|
6
+ # TODO: The :index method is deprecated in 1.9 in favor of :key
7
+ # but we don't have :key in 1.8.7. We can remove this check when
8
+ # stop supporting 1.8.x
9
key_method = Hash.method_defined?('key') ? 'key' : 'index'
10
name = Rails.application.routes.named_routes.routes.send(key_method, route).to_s
11
reqs = route.requirements.empty? ? "" : route.requirements.inspect
0 commit comments