From a8b1ca26d77823e7f51b9be1b64ff1aa5cc125b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 12 Apr 2010 16:49:41 +0200 Subject: Ensure match path, :controller => name works as expected. --- actionpack/lib/action_dispatch/routing/mapper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb') 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 -- cgit v1.2.3