Class: ActionView::ObjectRenderer
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
PartialRenderer ,
AbstractRenderer
|
|
Instance Chain:
|
|
Inherits: |
ActionView::PartialRenderer
|
Defined in: | actionview/lib/action_view/renderer/object_renderer.rb |
Constant Summary
AbstractRenderer
- Inherited
Class Attribute Summary
PartialRenderer
- Inherited
.collection_cache | Fallback cache store if Action View is used without |
Class Method Summary
- .new(lookup_context, options) ⇒ ObjectRenderer constructor
PartialRenderer
- Inherited
AbstractRenderer
- Inherited
Instance Attribute Summary
Instance Method Summary
- #render_object_derive_partial(object, context, block)
- #render_object_with_partial(object, partial, context, block)
- #render_partial_template(view, locals, template, layout, block) private
- #template_keys(path) private
PartialRenderer
- Inherited
CollectionCaching
- Included
#cache_collection_render, #collection_by_cache_keys, #expanded_cache_key, | |
#fetch_or_cache_partial |
|
#will_cache? |
AbstractRenderer
- Inherited
Constructor Details
.new(lookup_context, options) ⇒ ObjectRenderer
# File 'actionview/lib/action_view/renderer/object_renderer.rb', line 7
def initialize(lookup_context, ) 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