Flowdock
method

collection_with_template

Importance_0
v3.0.5 - Show latest stable - 0 notes - Class: ActionView::Partials::PartialRenderer
collection_with_template(template = @template) public

No documentation

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

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