Class: ActionView::ObjectRenderer

Inherits:
PartialRenderer show all
Includes:
ObjectRendering
Defined in:
actionview/lib/action_view/renderer/object_renderer.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from PartialRenderer

#render

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Methods inherited from AbstractRenderer

#render

Constructor Details

#initialize(lookup_context, options) ⇒ ObjectRenderer

Returns a new instance of ObjectRenderer.



7
8
9
10
11
# 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) ⇒ Object



19
20
21
22
# 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) ⇒ Object



13
14
15
16
17
# 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