diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 00:27:33 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 00:27:33 +0000 |
commit | 98c16a3320c8f018b6c30a54f61743c540c517f4 (patch) | |
tree | 5e490f8e0ed5f0916c06010f00c8f4a9ca7e8871 /actionpack/lib | |
parent | 79365a0184c58def99aff4c4b213048a25179f6a (diff) | |
download | rails-98c16a3320c8f018b6c30a54f61743c540c517f4.tar.gz rails-98c16a3320c8f018b6c30a54f61743c540c517f4.tar.bz2 rails-98c16a3320c8f018b6c30a54f61743c540c517f4.zip |
Added fourth argument to render_collection_of_partials that allows you to specify local_assigns -- just like render_partial #432 [zenspider]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@383 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/partials.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/partials.rb b/actionpack/lib/action_view/partials.rb index 927ef2a977..1255a060dd 100644 --- a/actionpack/lib/action_view/partials.rb +++ b/actionpack/lib/action_view/partials.rb @@ -39,11 +39,11 @@ module ActionView render("#{path}/_#{partial_name}", { partial_name => object }.merge(local_assigns)) end - def render_collection_of_partials(partial_name, collection, partial_spacer_template = nil) + def render_collection_of_partials(partial_name, collection, partial_spacer_template = nil, local_assigns = {}) collection_of_partials = Array.new counter_name = partial_counter_name(partial_name) collection.each_with_index do |element, counter| - collection_of_partials.push(render_partial(partial_name, element, counter_name => counter)) + collection_of_partials.push(render_partial(partial_name, element, { counter_name => counter }.merge(local_assigns))) end return nil if collection_of_partials.empty? |