Flowdock
method

render_partial_to_object

Importance_0
v6.1.3.1 - Show latest stable - 0 notes - Class: Renderer
  • 1.0.0
  • 1.1.6
  • 1.2.6
  • 2.0.3
  • 2.1.0
  • 2.2.1
  • 2.3.2
  • 2.3.8
  • 3.0.0
  • 3.0.9
  • 3.1.0
  • 3.2.1
  • 3.2.8
  • 3.2.13
  • 4.0.2
  • 4.1.8
  • 4.2.1
  • 4.2.7
  • 4.2.9
  • 5.0.0.1
  • 5.1.7
  • 5.2.3
  • 6.0.0 (0)
  • 6.1.3.1 (0)
  • What's this?
render_partial_to_object(context, options, &block) public

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/renderer.rb, line 64
    def render_partial_to_object(context, options, &block) #:nodoc:
      partial = options[:partial]
      if String === partial
        collection = collection_from_options(options)

        if collection
          # Collection + Partial
          renderer = CollectionRenderer.new(@lookup_context, options)
          renderer.render_collection_with_partial(collection, partial, context, block)
        else
          if options.key?(:object)
            # Object + Partial
            renderer = ObjectRenderer.new(@lookup_context, options)
            renderer.render_object_with_partial(options[:object], partial, context, block)
          else
            # Partial
            renderer = PartialRenderer.new(@lookup_context, options)
            renderer.render(partial, context, block)
          end
        end
      else
        collection = collection_from_object(partial) || collection_from_options(options)

        if collection
          # Collection + Derived Partial
          renderer = CollectionRenderer.new(@lookup_context, options)
          renderer.render_collection_derive_partial(collection, context, block)
        else
          # Object + Derived Partial
          renderer = ObjectRenderer.new(@lookup_context, options)
          renderer.render_object_derive_partial(partial, context, block)
        end
      end
    end
Register or log in to add new notes.