instance method
collection_with_template
Ruby on Rails 4.1.16
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 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
Defined in actionview/lib/action_view/renderer/partial_renderer.rb line 386
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::PartialRenderer