diff --git a/actionview/lib/action_view/renderer/collection_renderer.rb b/actionview/lib/action_view/renderer/collection_renderer.rb index 5e37efa641c..9c4e4409c40 100644 --- a/actionview/lib/action_view/renderer/collection_renderer.rb +++ b/actionview/lib/action_view/renderer/collection_renderer.rb @@ -89,7 +89,7 @@ module ActionView template = find_template(partial, @locals.keys + iter_vars) layout = if !block && (layout = @options[:layout]) - find_template(layout.to_s, @locals.keys + iter_vars) + find_template(layout.to_s, @locals.keys + iter_vars) end render_collection(collection, context, partial, template, layout, block) @@ -129,8 +129,8 @@ module ActionView end collection_body = if template - cache_collection_render(payload, view, template, collection) do |collection| - collection_with_template(view, template, layout, collection) + cache_collection_render(payload, view, template, collection) do |filtered_collection| + collection_with_template(view, template, layout, filtered_collection) end else collection_with_template(view, nil, layout, collection) diff --git a/actionview/lib/action_view/renderer/renderer.rb b/actionview/lib/action_view/renderer/renderer.rb index d9973c7ebe5..b9278adafd2 100644 --- a/actionview/lib/action_view/renderer/renderer.rb +++ b/actionview/lib/action_view/renderer/renderer.rb @@ -100,7 +100,6 @@ module ActionView end private - def collection_from_options(options) if options.key?(:collection) collection = options[:collection]