Form does not update turbo-frame

I have a form

<turbo-frame id="goals">
    <form action="/add_goal">
        <label for="goal_name">Goal Name</label>
        <input type="text" id="goal_name" name="goal_name" placeholder="Goal name..">
        <input type="submit" value="Add Goal">

that I want to replace.

As a reply I send 303 and “Location: /added_goal” and “/added_goal” returns

<turbo-frame id="goals">

Turbo sets the src on turbo-frame but does not replace the content.

Hi Stephan,

you do not need a turbo frame to submit a form. Just use a normal form with id like:

  <form action="/activities/new"
     <!-- form content -->

Then just return a Turbo stream with id of the form and action replace like:

<turbo-stream action="replace" target="b__activity_edit">

I use that in my side project Baralga, a web based time tracker GitHub - Baralga/backend: Baralga Server Backend for multi-user capable time tracking.