Module: Frails::Monkey::ActionView::Renderer
- Defined in:
- lib/frails/monkey/action_view/renderer.rb
Instance Method Summary collapse
-
#render_component(context, options, &block) ⇒ Object
Direct access to partial rendering.
- #render_component_to_object(context, options, &block) ⇒ Object
- #render_to_object(context, options) ⇒ Object
Instance Method Details
#render_component(context, options, &block) ⇒ Object
Direct access to partial rendering.
18 19 20 |
# File 'lib/frails/monkey/action_view/renderer.rb', line 18 def render_component(context, , &block) render_component_to_object(context, , &block).body end |
#render_component_to_object(context, options, &block) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/frails/monkey/action_view/renderer.rb', line 22 def render_component_to_object(context, , &block) component = [:component].to_s result = if Frails.components_path.join(component, 'index.entry.jsx').exist? Frails::Component::ReactRenderer.new.render(context, , &block) else Frails::Component::Renderer.new(@lookup_context) .render(context, , &block) end ::ActionView::AbstractRenderer::RenderedTemplate.new result, nil, nil end |
#render_to_object(context, options) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/frails/monkey/action_view/renderer.rb', line 7 def render_to_object(context, ) if .key?(:partial) render_partial_to_object(context, ) elsif .key?(:component) render_component_to_object(context, ) else render_template_to_object(context, ) end end |