diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index e0b725c8f2..565609542a 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -260,14 +260,19 @@ module ActionDispatch end end - controller = controller.to_s unless controller.is_a?(Regexp) + hash = {} + action = action.to_s unless action.is_a?(Regexp) + if controller.is_a? Regexp + hash[:controller] = controller + else + check_controller! controller.to_s + hash[:controller] = controller.to_s if controller + end + check_action! action - check_controller! controller - hash = {} - hash[:controller] = controller unless controller.blank? hash[:action] = action unless action.blank? hash end |