aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-02-12 20:20:14 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-02-12 20:20:14 +0100
commit8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465 (patch)
tree28a0f8bbbf0a2aaf31cd853e2d8e4dc7dc643ad0 /actionpack/lib/action_dispatch
parentda1fbb9a00e330331d00f27c8a40ea62d0d1d224 (diff)
parent4e3931aac20bc17e935dfbbbdf46ed1d2131ec74 (diff)
downloadrails-8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465.tar.gz
rails-8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465.tar.bz2
rails-8c53b41293cd27a1d0c0b1d6d9f51f04f20ca465.zip
Merge pull request #23611 from abhishekjain16/routes_options
Fix routes to match verb and URL path with -g option also.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/inspector.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb
index b806ee015b..983f1daeb3 100644
--- a/actionpack/lib/action_dispatch/routing/inspector.rb
+++ b/actionpack/lib/action_dispatch/routing/inspector.rb
@@ -84,14 +84,15 @@ module ActionDispatch
if filter.is_a?(Hash) && filter[:controller]
{ controller: /#{filter[:controller].downcase.sub(/_?controller\z/, '').sub('::', '/')}/ }
elsif filter
- { controller: /#{filter}/, action: /#{filter}/ }
+ { controller: /#{filter}/, action: /#{filter}/, verb: /#{filter}/, name: /#{filter}/, path: /#{filter}/ }
end
end
def filter_routes(filter)
if filter
@routes.select do |route|
- filter.any? { |default, value| route.defaults[default] =~ value }
+ route_wrapper = RouteWrapper.new(route)
+ filter.any? { |default, value| route_wrapper.send(default) =~ value }
end
else
@routes