aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-08-20 20:41:19 +0900
committerGitHub <noreply@github.com>2018-08-20 20:41:19 +0900
commitffca883908432f61a1fefdbcef5b1c10a7223acb (patch)
tree28ab88d65c8bc8d491d0592e7d98f5b1f2674fb3 /actionpack
parent3e3a0d1cc31ff929de2b27f2e6790d2ccdde9e2c (diff)
parente2d0b3b375049546b23fdd33147155cdcc6b032e (diff)
downloadrails-ffca883908432f61a1fefdbcef5b1c10a7223acb.tar.gz
rails-ffca883908432f61a1fefdbcef5b1c10a7223acb.tar.bz2
rails-ffca883908432f61a1fefdbcef5b1c10a7223acb.zip
Merge pull request #33662 from yskkin/multi_word_route
Fix `rails routes -c` for controller name consists of multiple word.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/inspector.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb
index cba49d1a0b..413e524ef6 100644
--- a/actionpack/lib/action_dispatch/routing/inspector.rb
+++ b/actionpack/lib/action_dispatch/routing/inspector.rb
@@ -83,7 +83,7 @@ module ActionDispatch
private
def normalize_filter(filter)
if filter[:controller]
- { controller: /#{filter[:controller].downcase.sub(/_?controller\z/, '').sub('::', '/')}/ }
+ { controller: /#{filter[:controller].underscore.sub(/_?controller\z/, "")}/ }
elsif filter[:grep]
{ controller: /#{filter[:grep]}/, action: /#{filter[:grep]}/,
verb: /#{filter[:grep]}/, name: /#{filter[:grep]}/, path: /#{filter[:grep]}/ }