Link to turbo frame not working, navigating full page instead

Viewed 1040

I have the following code:

<%= turbo_frame_tag :my_frame do %>
  frame
<% end %>

<%= link_to "About", about_path, data: { turbo_frame: :my_frame } %>

When I click the "About" link, the frame's content doesn't get updated. Instead, the whole page navigates to about_path.

I know that it's not a problem with the above code because I tested the same exact code on a fresh app and it worked fine. Something about this app is different that's making this turbo frame link not work.

Any ideas?

1 Answers

I assume you are overriding the navigation. According to the documentation, you code should be

<%= turbo_frame_tag :my_frame do %>
  frame
  
  <%= link_to "About", about_path %>
<% end %>


Related