I do a form POST to my controller. I get a TURBO_STREAM request. I respond with a turbo_stream response, which renders a partial with some data. I see the response in my browser.
def create
# do some stuff to ensure our partial will be happy
@stuff = "yay"
respond_to do |format|
format.turbo_stream { render turbo_stream: turbo_stream.replace("my_target", partial: "goober/gobber", locals: {stuff: @stuff}) }
format.html { render :index, status: :unprocessable_entity }
end
end
What I see in my browser as a response to the POST is the stream from the partial.
<turbo-stream action="replace" target="my_target"><template><h1>Sample Report lalalalal</h1></template></turbo-stream>
My template originally rendered with an element:
<turbo-stream action="replace" target="my_target"></turbo-stream>
So the browser in not doing anything with the response? What am I doing wrong here? Seems like I should see something like
<h1>Sample Report lalalalal</h1>
in the DOM… inside that element