123456789_123456789_123456789_123456789_123456789_

Class: ActionView::ObjectRenderer

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActionView::PartialRenderer
Defined in: actionview/lib/action_view/renderer/object_renderer.rb

Constant Summary

AbstractRenderer - Inherited

NO_DETAILS

Class Attribute Summary

PartialRenderer - Inherited

.collection_cache

Fallback cache store if Action View is used without ::Rails.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(lookup_context, options) ⇒ ObjectRenderer

[ GitHub ]

  
# File 'actionview/lib/action_view/renderer/object_renderer.rb', line 7

def initialize(lookup_context, options)
  super
  @object     = nil
  @local_name = nil
end

Instance Method Details

#render_object_derive_partial(object, context, block)

[ GitHub ]

  
# File 'actionview/lib/action_view/renderer/object_renderer.rb', line 19

def render_object_derive_partial(object, context, block)
  path = partial_path(object, context)
  render_object_with_partial(object, path, context, block)
end

#render_object_with_partial(object, partial, context, block)

[ GitHub ]

  
# File 'actionview/lib/action_view/renderer/object_renderer.rb', line 13

def render_object_with_partial(object, partial, context, block)
  @object     = object
  @local_name = local_variable(partial)
  render(partial, context, block)
end

#render_partial_template(view, locals, template, layout, block) (private)

[ GitHub ]

  
# File 'actionview/lib/action_view/renderer/object_renderer.rb', line 29

def render_partial_template(view, locals, template, layout, block)
  locals[@local_name || template.variable] = @object
  super(view, locals, template, layout, block)
end

#template_keys(path) (private)

[ GitHub ]

  
# File 'actionview/lib/action_view/renderer/object_renderer.rb', line 25

def template_keys(path)
  super + [@local_name]
end