From b611c685d92038b199149e8eec900c3058523ab7 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 10 Sep 2007 14:31:44 +0000 Subject: 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 --- actionpack/lib/action_controller/resources.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_controller') 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 -- cgit v1.2.3