diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-25 10:14:44 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-25 10:14:44 -0800 |
commit | 7f5d44bac548c9f80e2ea88e191356dbb099593e (patch) | |
tree | 0248f32cfa85d4bceeb4b9d99195d52e40c6b625 /actionpack/lib/action_dispatch/routing | |
parent | a8f1ee59868a804ece386264385223d08e122918 (diff) | |
download | rails-7f5d44bac548c9f80e2ea88e191356dbb099593e.tar.gz rails-7f5d44bac548c9f80e2ea88e191356dbb099593e.tar.bz2 rails-7f5d44bac548c9f80e2ea88e191356dbb099593e.zip |
The controller key shouldnt be part of the mapping if its not used
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 4 |
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") |