Skip to content

Commit f03b935

Browse files
justin808claude
andcommitted
Fix Turbo navigation by updating to Turbo-compatible script tag
When navigating between pages with Turbo, JavaScript wasn't being re-initialized because the layout was using old Turbolinks data attributes instead of Turbo attributes. Changes: - spec/dummy/app/views/layouts/application.html.erb: - Change data-turbolinks-track to data-turbo-track="reload" - Add defer: true to ensure proper script loading order with Turbo This ensures React components properly hydrate on Turbo navigation, not just on hard refresh. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 70ca7b3 commit f03b935

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/dummy/app/views/layouts/application.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<%= yield :head %>
1111

1212
<!-- NOTE: Must use defer and not async to keep async scripts loading in correct order -->
13-
<%= javascript_pack_tag('client-bundle', 'data-turbolinks-track': true) %>
13+
<%= javascript_pack_tag('client-bundle', 'data-turbo-track': 'reload', defer: true) %>
1414

1515
<%= csrf_meta_tags %>
1616
</head>

0 commit comments

Comments
 (0)