aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 565609542a..178728ea2a 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -262,8 +262,6 @@ module ActionDispatch
hash = {}
- action = action.to_s unless action.is_a?(Regexp)
-
if controller.is_a? Regexp
hash[:controller] = controller
else
@@ -271,9 +269,13 @@ module ActionDispatch
hash[:controller] = controller.to_s if controller
end
- check_action! action
+ if action.is_a? Regexp
+ hash[:action] = action
+ else
+ check_action! action.to_s
+ hash[:action] = action.to_s if action
+ end
- hash[:action] = action unless action.blank?
hash
end
end