From 7f5d44bac548c9f80e2ea88e191356dbb099593e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 25 Dec 2009 10:14:44 -0800 Subject: The controller key shouldnt be part of the mapping if its not used --- actionpack/lib/action_dispatch/routing/mapper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index a6b32e0152..b48fc6edc5 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -92,9 +92,9 @@ module ActionDispatch controller, action = to.split('#') { :controller => controller, :action => action } when Symbol - { :controller => default_controller, :action => to.to_s } + { :action => to.to_s }.merge(default_controller ? { :controller => default_controller } : {}) else - { :controller => default_controller } + default_controller ? { :controller => default_controller } : {} end if defaults[:controller].blank? && segment_keys.exclude?("controller") -- cgit v1.2.3