aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 3e15caee2d..9c30f2a27a 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -124,11 +124,13 @@ module ActionDispatch
controller, action = to.split('#')
{ :controller => controller, :action => action }
when Symbol
- { :action => to.to_s }.merge(default_controller ? { :controller => default_controller } : {})
+ { :action => to.to_s }
else
- default_controller ? { :controller => default_controller } : {}
+ {}
end
+ defaults[:controller] ||= @options[:controller] || default_controller
+
if defaults[:controller].blank? && segment_keys.exclude?("controller")
raise ArgumentError, "missing :controller"
end