Flowdock
method

render_partial

Importance_0
v2.1.0 - Show latest stable - 0 notes - Class: ActionView::Partials
render_partial(partial_path, object_assigns = nil, local_assigns = {}) 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 106
      def render_partial(partial_path, object_assigns = nil, local_assigns = {}) #:nodoc:
        case partial_path
        when String, Symbol, NilClass
          # Render the template
          ActionView::PartialTemplate.new(self, partial_path, object_assigns, local_assigns).render_template
        when ActionView::Helpers::FormBuilder
          builder_partial_path = partial_path.class.to_s.demodulize.underscore.sub(/_builder$/, '')
          render_partial(builder_partial_path, object_assigns, (local_assigns || {}).merge(builder_partial_path.to_sym => partial_path))
        when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope
          if partial_path.any?
            collection = partial_path
            render_partial_collection(nil, collection, nil, local_assigns)
          else
            ""
          end
        else
          render_partial(ActionController::RecordIdentifier.partial_path(partial_path, controller.class.controller_path), partial_path, local_assigns)
        end
      end
Register or log in to add new notes.