instance method
collection_with_template
Ruby on Rails 4.2.9
Since v3.2.22.5 Last seen in v6.0.6 PrivateSignature
collection_with_template()
No documentation comment.
Source
# File actionview/lib/action_view/renderer/partial_renderer.rb, line 421
def collection_with_template
view, locals, template = @view, @locals, @template
as, counter, iteration = @variable, @variable_counter, @variable_iteration
if layout = @options[:layout]
layout = find_template(layout, @template_keys)
end
partial_iteration = PartialIteration.new(@collection.size)
locals[iteration] = partial_iteration
@collection.map do |object|
locals[as] = object
locals[counter] = partial_iteration.index
content = template.render(view, locals)
content = layout.render(view, locals) { content } if layout
partial_iteration.iterate!
content
end
end
Defined in actionview/lib/action_view/renderer/partial_renderer.rb line 421
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::PartialRenderer