aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
authorJamison Dance <jergason@gmail.com>2010-08-26 21:20:22 -0600
committerJamison Dance <jergason@gmail.com>2010-08-26 21:20:22 -0600
commit6398eba2400af004d9db19217f9d43ea7a33d877 (patch)
treef9f0755bbf42a2a86eff5a6b4d9bb46902745bee /actionpack/lib/action_dispatch/routing
parent4d8158d9e5ada4aff5dc62712b7c4730b60cde48 (diff)
parent6eed7b36a2ec6f94d9ac3f254b05697649b78881 (diff)
downloadrails-6398eba2400af004d9db19217f9d43ea7a33d877.tar.gz
rails-6398eba2400af004d9db19217f9d43ea7a33d877.tar.bz2
rails-6398eba2400af004d9db19217f9d43ea7a33d877.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 9aa34e7ba5..9a92ed0b62 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -695,15 +695,14 @@ module ActionDispatch
raise ArgumentError, "Unknown scope #{on.inspect} given to :on"
end
- if @scope[:scope_level] == :resource
+ if @scope[:scope_level] == :resources
+ args.push(options)
+ return nested { match(*args) }
+ elsif @scope[:scope_level] == :resource
args.push(options)
return member { match(*args) }
end
- if resource_scope?
- raise ArgumentError, "can't define route directly in resource(s) scope"
- end
-
action = args.first
path = path_for_action(action, options.delete(:path))
@@ -900,6 +899,8 @@ module ActionDispatch
end
name = case @scope[:scope_level]
+ when :nested
+ [member_name, prefix]
when :collection
[prefix, name_prefix, collection_name]
when :new