diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/partials.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index d23a2abb04..701531fa95 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added fourth argument to render_collection_of_partials that allows you to specify local_assigns -- just like render_partial #432 [zenspider] + * Fixed that host would choke when cgi.host returned nil #432 [Tobias Luetke] * Added that form helpers now take an index option #448 [Tim Bates] 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? |