instance method
render_collection
Ruby on Rails 6.0.6
Since v3.2.22.5 Last seen in v6.0.6 PrivateSignature
render_collection(view, template)
No documentation comment.
Parameters
-
viewreq -
templatereq
Source
# File actionview/lib/action_view/renderer/partial_renderer.rb, line 322
def render_collection(view, template)
identifier = (template && template.identifier) || @path
instrument(:collection, identifier: identifier, count: @collection.size) do |payload|
return RenderedCollection.empty(@lookup_context.formats.first) if @collection.blank?
spacer = if @options.key?(:spacer_template)
spacer_template = find_template(@options[:spacer_template], @locals.keys)
build_rendered_template(spacer_template.render(view, @locals), spacer_template)
else
RenderedTemplate::EMPTY_SPACER
end
collection_body = if template
cache_collection_render(payload, view, template) do
collection_with_template(view, template)
end
else
collection_without_template(view)
end
build_rendered_collection(collection_body, spacer)
end
end
Defined in actionview/lib/action_view/renderer/partial_renderer.rb line 322
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::PartialRenderer