Add parent_layout helper

This commit is contained in:
Andreas Nedbal 2020-04-25 17:02:59 +02:00
parent 9ee5811243
commit 8b8a5a1e72
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
module LayoutsHelper
def parent_layout(layout)
@view_flow.set(:layout, output_buffer)
output = render(file: "layouts/#{layout}")
@haml_buffer.buffer.replace output
self.output_buffer = ActionView::OutputBuffer.new(output)
end
end