aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-05-17 17:36:34 +0200
committerJosé Valim <jose.valim@gmail.com>2010-05-17 17:39:32 +0200
commit107c6381a0a3403461f1dc00e140565028af73e1 (patch)
tree62f5c130b243b4dd7196ece86609b8b7a9f91766 /actionpack/lib/action_dispatch/routing/mapper.rb
parent5371242384171dc0255716e31e9257ddeec17d10 (diff)
downloadrails-107c6381a0a3403461f1dc00e140565028af73e1.tar.gz
rails-107c6381a0a3403461f1dc00e140565028af73e1.tar.bz2
rails-107c6381a0a3403461f1dc00e140565028af73e1.zip
Allow root to be given in the resources scope without need to specify :on => collection.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 4b02c2deb3..8a8d21c434 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -693,6 +693,11 @@ module ActionDispatch
super
end
+ def root(options={})
+ options[:on] ||= :collection if @scope[:scope_level] == :resources
+ super(options)
+ end
+
protected
def parent_resource #:nodoc:
@scope[:scope_level_resource]