Flowdock
method

render_partial_collection

Importance_0
v2.3.8 - Show latest stable - 0 notes - Class: ActionView::Partials
render_partial_collection(options = {}) private

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/partials.rb, line 207
      def render_partial_collection(options = {}) #:nodoc:
        return nil if options[:collection].blank?

        partial = options[:partial]
        spacer = options[:spacer_template] ? render(:partial => options[:spacer_template]) : ''
        local_assigns = options[:locals] ? options[:locals].clone : {}
        as = options[:as]

        index = 0
        options[:collection].map do |object|
          _partial_path ||= partial ||
            ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path)
          template = _pick_partial_template(_partial_path)
          local_assigns[template.counter_name] = index
          local_assigns["#{as.to_s}_counter".to_sym] = local_assigns[template.counter_name] if as
          result = template.render_partial(self, object, local_assigns.dup, as)
          index += 1
          result
        end.join(spacer).html_safe
      end
Register or log in to add new notes.