aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2009-12-25 10:14:44 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2009-12-25 10:14:44 -0800
commit7f5d44bac548c9f80e2ea88e191356dbb099593e (patch)
tree0248f32cfa85d4bceeb4b9d99195d52e40c6b625
parenta8f1ee59868a804ece386264385223d08e122918 (diff)
downloadrails-7f5d44bac548c9f80e2ea88e191356dbb099593e.tar.gz
rails-7f5d44bac548c9f80e2ea88e191356dbb099593e.tar.bz2
rails-7f5d44bac548c9f80e2ea88e191356dbb099593e.zip
The controller key shouldnt be part of the mapping if its not used
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb4
1 files changed, 2 insertions, 2 deletions
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")