Skip to content
Browse files

The controller key shouldnt be part of the mapping if its not used

  • Loading branch information...
1 parent a8f1ee5 commit 7f5d44bac548c9f80e2ea88e191356dbb099593e @dhh dhh committed Dec 25, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_dispatch/routing/mapper.rb
View
4 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -92,9 +92,9 @@ def defaults
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")

0 comments on commit 7f5d44b

Please sign in to comment.
Something went wrong with that request. Please try again.