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
:nodoc:.
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) #:nodoc: 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 34 |
# File 'lib/frails/monkey/action_view/renderer.rb', line 22 def render_component_to_object(context, , &block) component = [:component].to_s result = if Rails.root.join('app', 'components', component, 'index.entry.jsx').exist? Frails::Component::ReactComponentRenderer.new.render(context, , &block) else [:partial] = "#{component}/index" Frails::Component::ComponentRenderer.new(@lookup_context) .render(context, , &block) end ::ActionView::AbstractRenderer::RenderedTemplate.new result, nil, nil end |
#render_to_object(context, options) ⇒ Object
:nodoc:
7 8 9 10 11 12 13 14 15 |
# File 'lib/frails/monkey/action_view/renderer.rb', line 7 def render_to_object(context, ) # :nodoc: if .key?(:partial) render_partial_to_object(context, ) elsif .key?(:component) render_component_to_object(context, ) else render_template_to_object(context, ) end end |