Nathan Hamilton
Joined
10 Experience
0 Lessons Completed
0 Questions Solved
Activity
Hey Jake,
This is really helpful so thank you!
You are posting this as it should be laid out in the controller, but in my case, I am actually using a turbo stream page called index.turbo_stream.erb
to render the contents from the server. I am experiencing the exact same issue described in the original post, but I can't figure out how to have turbo recognize this and render the content.
Here's what that index.turbo_stream.erb looks like:
<%= turbo_stream_action_tag(
"append",
target: "card-list",
template: %(#{render partial: 'admin/card', collection: @results, as: :result })
) %>
<%= turbo_stream_action_tag(
"replace",
target: "pager",
template: %(#{render "pager", pagy: @pagy})
) %>
In my controller I'm simply doing the following:
respond_to do |format|
format.html
format.turbo_stream
end
How do I modify the stream template to recognize the partial and render the content correctly?