method

collection_with_template

Importance_0
v4.2.1 - Show latest stable - 0 notes - Class: PartialRenderer
collection_with_template() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide 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
Register or log in to add new notes.