aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-08-26 14:26:42 +0200
committerXavier Noria <fxn@hashref.com>2010-08-26 14:26:42 +0200
commitc1b5e2a2d5a59eebe017f63088b9478b7151d6d2 (patch)
tree1ff41d8b9c9060cc7f168b38bc07b220ca2e715f /actionpack/lib/action_dispatch
parent0f9eedf6de72f4afacde6d7075c588a7a6fd3ad6 (diff)
parente72406e2ba3cd3a5d72fea6219f152640e2e7479 (diff)
downloadrails-c1b5e2a2d5a59eebe017f63088b9478b7151d6d2.tar.gz
rails-c1b5e2a2d5a59eebe017f63088b9478b7151d6d2.tar.bz2
rails-c1b5e2a2d5a59eebe017f63088b9478b7151d6d2.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'actionpack/lib/action_dispatch')
-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