method

collection_with_template

rails latest stable - Class: ActionView::Partials::PartialRenderer

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.0.9) is shown here.

collection_with_template(template = @template)
public

No documentation available.

# File actionpack/lib/action_view/render/partials.rb, line 284
      def collection_with_template(template = @template)
        segments, locals, template = [], @locals, @template

        if @options[:as]
          as = @options[:as]
          counter = "#{as}_counter".to_sym
        else
          as = template.variable_name
          counter = template.counter_name
        end

        locals[counter] = -1

        @collection.each do |object|
          locals[counter] += 1
          locals[as] = object
          segments << template.render(@view, locals)
        end

        segments
      end