Skip to content

Commit 315322a

Browse files
committed
fixed layout resolving issue when using turbo-rails gem
1 parent 0ff8d01 commit 315322a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matestack/ui/core/helper.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ def render(*args)
3636
if controller_layout == false
3737
root_layout = layout ? layout.layout : false
3838
else
39-
if controller_layout.nil?
39+
# when using the turbo-rails gem, controller_layout is a Proc
40+
# https://github.com/hotwired/turbo-rails/blob/v1.0.1/app/controllers/turbo/frames/frame_request.rb#L16
41+
# and not nil or a string indicating which layout to be used like before
42+
if controller_layout.nil? || controller_layout.is_a?(Proc)
4043
root_layout = "application"
4144
else
4245
root_layout = controller_layout

0 commit comments

Comments
 (0)