Skip to content

Commit 7ca7a35

Browse files
committed
Render full documents for requests with Turbo-Frame: header
Re-submission of [#232][] Related to [hotwired/turbo#1047][] Render full documents, including default layout rendering behavior. Rendering a minimal layout forces `turbo:reload` events because of the severe difference in the contents of the minimal layout's `<head>` and the requesting document's fully populated `<head>`. [#232]: #232 [hotwired/turbo#1047]: hotwired/turbo#1047
1 parent 59e1f48 commit 7ca7a35

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

app/controllers/turbo/frames/frame_request.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module Turbo::Frames::FrameRequest
2121
extend ActiveSupport::Concern
2222

2323
included do
24-
layout -> { "turbo_rails/frame" if turbo_frame_request? }
2524
etag { :frame if turbo_frame_request? }
2625

2726
helper_method :turbo_frame_request?, :turbo_frame_request_id

app/views/layouts/turbo_rails/frame.html.erb

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/frames/frame_request_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Turbo::FrameRequestControllerTest < ActionDispatch::IntegrationTest
66
assert_select "title", count: 1
77

88
get tray_path(id: 1), headers: { "Turbo-Frame" => "true" }
9-
assert_select "title", count: 0
9+
assert_select "title", count: 1
1010
end
1111

1212
test "frame request layout includes `head` content" do
@@ -22,7 +22,7 @@ class Turbo::FrameRequestControllerTest < ActionDispatch::IntegrationTest
2222
end
2323

2424
assert_select "meta[name=test][content=present]"
25-
assert_select "meta[name=alternative][content=present]"
25+
assert_select "meta[name=alternative][content=present]", count: 0
2626
end
2727

2828
test "frame requests get a unique etag" do

0 commit comments

Comments
 (0)