Method: Tuning::Extensions::ActionView::Base#extending

Defined in:
lib/tuning/extensions/action_view/base.rb

#extending(layout, &block) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/tuning/extensions/action_view/base.rb', line 19

def extending(layout, &block)
  if block_given?
    old_layout = @view_flow.get(:layout)
    new_layout = (capture(&block) || '')
    old_layout.replace(new_layout)
  end
  render file: "layouts/#{layout}"
end