I have a <turbo-frame id="modal">
tag in my rails layout outside of the <%= yield %>
and when I try to render content in the turbo-frame from within the yield it does not render the HTML inside the turbo-frame. The src
attribute updates to <turbo-frame id="modal" src="https://my-url">
and there are no errors on the page or server.
If I move the <turbo-frame id="modal">
inside the yielded content, then it will render the HTML inside the turbo-frame as expected but this is a global element I want on the layout.
I am using Turbo 8.
app/views/posts/edit.html.erb
<%= turbo_frame_tag "modal" do %>
Render edit form ...
<% end %>
app/views/posts/show.html.erb
<%= link_to 'edit', edit_post_path(post), data: {turbo_frame: 'modal' } %>
app/views/layouts/application.html.erb
<body>
<%= turbo_frame_tag "modal" %>
<%= yield %>
<body>
Is this the expected behavior? If not, what am I doing wrong?