aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-10 14:31:44 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-10 14:31:44 +0000
commitb611c685d92038b199149e8eec900c3058523ab7 (patch)
tree4bd81aa0be6d0a39da2a415f3b6fabe0310dbcbc /actionpack/lib/action_controller
parentbf8a4b000602a12ba04d105b9c97f900c410e341 (diff)
downloadrails-b611c685d92038b199149e8eec900c3058523ab7.tar.gz
rails-b611c685d92038b199149e8eec900c3058523ab7.tar.bz2
rails-b611c685d92038b199149e8eec900c3058523ab7.zip
Fixed that resource namespaces wouldnt stick to all nested resources (closes #9399) [pixeltrix]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7447 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/resources.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb
index e909a65eab..7b311e5eb7 100644
--- a/actionpack/lib/action_controller/resources.rb
+++ b/actionpack/lib/action_controller/resources.rb
@@ -394,7 +394,7 @@ module ActionController
map_associations(resource, options)
if block_given?
- with_options(:path_prefix => resource.nesting_path_prefix, :name_prefix => resource.nesting_name_prefix, &block)
+ with_options(:path_prefix => resource.nesting_path_prefix, :name_prefix => resource.nesting_name_prefix, :namespace => options[:namespace], &block)
end
end
end
@@ -411,7 +411,7 @@ module ActionController
map_associations(resource, options)
if block_given?
- with_options(:path_prefix => resource.nesting_path_prefix, :name_prefix => resource.nesting_name_prefix, &block)
+ with_options(:path_prefix => resource.nesting_path_prefix, :name_prefix => resource.nesting_name_prefix, :namespace => options[:namespace], &block)
end
end
end
@@ -419,14 +419,13 @@ module ActionController
def map_associations(resource, options)
path_prefix = "#{options.delete(:path_prefix)}#{resource.nesting_path_prefix}"
name_prefix = "#{options.delete(:name_prefix)}#{resource.nesting_name_prefix}"
- namespace = options.delete(:namespace)
Array(options[:has_many]).each do |association|
- resources(association, :path_prefix => path_prefix, :name_prefix => name_prefix, :namespace => namespace)
+ resources(association, :path_prefix => path_prefix, :name_prefix => name_prefix, :namespace => options[:namespace])
end
Array(options[:has_one]).each do |association|
- resource(association, :path_prefix => path_prefix, :name_prefix => name_prefix, :namespace => namespace)
+ resource(association, :path_prefix => path_prefix, :name_prefix => name_prefix, :namespace => options[:namespace])
end
end