aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index a006a146ed..c968381c26 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -676,8 +676,8 @@ module ActionDispatch
# Remove leading slashes from controllers
def normalize_controller!
if controller
- if m = controller.match(/\A\/(?<controller_without_leading_slash>.*)/)
- @options[:controller] = m[:controller_without_leading_slash]
+ if controller.start_with?("/".freeze)
+ @options[:controller] = controller[1..-1]
else
@options[:controller] = controller
end