mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
Add parent_layout helper
This commit is contained in:
parent
9ee5811243
commit
8b8a5a1e72
1 changed files with 10 additions and 0 deletions
10
app/helpers/layouts_helper.rb
Normal file
10
app/helpers/layouts_helper.rb
Normal 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
|
Loading…
Reference in a new issue