diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 5027425d6b..72edf6725c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -247,16 +247,15 @@ module ActionDispatch @scope[:module] ) - if controller.is_a? Regexp + case controller + when Regexp hash[:controller] = controller + when String, Symbol + hash[:controller] = check_controller!(controller).to_s else - if controller - hash[:controller] = check_controller!(controller).to_s - else - unless segment_keys.include?(:controller) - message = "Missing :controller key on routes definition, please check your routes." - raise ArgumentError, message - end + unless segment_keys.include?(:controller) + message = "Missing :controller key on routes definition, please check your routes." + raise ArgumentError, message end end |