Module: Extensions::RenderWithinLayout::ActionView::Renderer

Defined in:
lib/extensions/render_within_layout/action_view/renderer.rb

Instance Method Summary collapse

Instance Method Details

#render_within_layout(context, layout, *_) ⇒ Object


3
4
5
6
# File 'lib/extensions/render_within_layout/action_view/renderer.rb', line 3

def render_within_layout(context, layout, *_)
  context.view_flow.set(:layout, context.capture { yield })
  context.render template: "layouts/#{layout}"
end