method
render_collection
v6.1.7.7 -
Show latest stable
-
0 notes -
Class: CollectionRenderer
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
render_collection(collection, view, path, template, layout, block)
private
Hide source
# File actionview/lib/action_view/renderer/collection_renderer.rb, line 145 def render_collection(collection, view, path, template, layout, block) identifier = (template && template.identifier) || path ActiveSupport::Notifications.instrument( "render_collection.action_view", identifier: identifier, layout: layout && layout.virtual_path, count: collection.length ) do |payload| 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, collection) do |filtered_collection| collection_with_template(view, template, layout, filtered_collection) end else collection_with_template(view, nil, layout, collection) end return RenderedCollection.empty(@lookup_context.formats.first) if collection_body.empty? build_rendered_collection(collection_body, spacer) end end