diff options
author | Abhishek Jain <jainabhishek1610@gmail.com> | 2016-02-11 15:16:33 +0530 |
---|---|---|
committer | Abhishek Jain <jainabhishek1610@gmail.com> | 2016-02-11 15:16:33 +0530 |
commit | 4e3931aac20bc17e935dfbbbdf46ed1d2131ec74 (patch) | |
tree | 7bb0cd22af29cba78a778d10e4681cc03f7a7041 /actionpack | |
parent | 31778a34a8c6e1d186c1e807491c1f44c5f07357 (diff) | |
download | rails-4e3931aac20bc17e935dfbbbdf46ed1d2131ec74.tar.gz rails-4e3931aac20bc17e935dfbbbdf46ed1d2131ec74.tar.bz2 rails-4e3931aac20bc17e935dfbbbdf46ed1d2131ec74.zip |
Fixes routes to match verbs and path with -g option
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/inspector.rb | 5 |
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 |