method
collection_with_template
v4.0.2 -
Show latest stable
- Class:
ActionView::PartialRenderer
collection_with_template()private
No documentation available.
# File actionpack/lib/action_view/renderer/partial_renderer.rb, line 386
def collection_with_template
view, locals, template = @view, @locals, @template
as, counter = @variable, @variable_counter
if layout = @options[:layout]
layout = find_template(layout, @template_keys)
end
index = -1
@collection.map do |object|
locals[as] = object
locals[counter] = (index += 1)
content = template.render(view, locals)
content = layout.render(view, locals) { content } if layout
content
end
end