Skip to content

Commit

Permalink
fixed layout resolving issue when using turbo-rails gem
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasjabari committed Apr 29, 2022
1 parent 0ff8d01 commit 315322a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/matestack/ui/core/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def render(*args)
if controller_layout == false
root_layout = layout ? layout.layout : false
else
if controller_layout.nil?
# when using the turbo-rails gem, controller_layout is a Proc
# https://github.com/hotwired/turbo-rails/blob/v1.0.1/app/controllers/turbo/frames/frame_request.rb#L16
# and not nil or a string indicating which layout to be used like before
if controller_layout.nil? || controller_layout.is_a?(Proc)
root_layout = "application"
else
root_layout = controller_layout
Expand Down

0 comments on commit 315322a

Please sign in to comment.