I am trying to load html into a turbo frame using the src attribute, but when I load the page the frame exists on I don't see a network request being issued to get the html.
This is the markup I have written on the rendered page:
<%= turbo_frame_tag "new_message", src: new_room_message_path(@room), target: "_top" do %>
<div>
placeholder
</div>
<% end %>
And the matching turbo frame in the new_room_message_path
view:
<h1>New Message</h1>
<%= turbo_frame_tag "new_message", target: "_top" do %>
<%= form_with(model: [ @message.room, @message ]) do |form| %>
<div class="field">
<%= form.text_field :content %>
<%= form.submit "send" %>
</div>
<% end %>
<% end %>
When I visit the new_room_message_path
in the browser the route and html look good.
application.js contents:
// Entry point for the build script in your package.json
import "@hotwired/turbo-rails"
import "./controllers"
import * as bootstrap from "bootstrap"
I am running this on rails 7.0.2.3
.
I have the gem "turbo-rails"
installed.
I see turbo being imported in the application.js import "@hotwired/turbo-rails"
.
Any tips on config or code changes I should try or am outright missing? If there's any more context that would be helpful, im happy to update the question.