Redirect create actions with 303 See Other so Turbo advances - #2536
Conversation
Turbo Drive needs a 303 (not 302) to navigate after a form POST. Without it, a successful create doesn't advance the page — the record saves but the user stays on the form and can re-submit, producing duplicate records. The update actions already used :see_other; align the create success redirects to match. Covers community_news, stories, events, workshops, resources, video_recordings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A real headless-browser test of the community news create flow, asserting the page leaves the form for the show page and exactly one record is created. It passes with a plain 302 as well as with 303, documenting that a POST create advances under Turbo either way — the see_other requirement is real only for the PATCH/DELETE update/destroy paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jmilljr24
left a comment
There was a problem hiding this comment.
I did a good bit a digging and finally found an explanation that made sense to me.
This pr would be considered "best practice" according to the turbo docs. A browser may handle other 3xx responses fine but the official support if for a redirect_to to set 303 with see_other.
Couldn't tell you if that was actually the root cause or it was a weird timing/server issue but I'm good with add see_other on this. Thanks
There was a problem hiding this comment.
ack, i merged before seeing this comment. ok w you to leave in?
There was a problem hiding this comment.
I commented after the merge so not on you. Yeah, no biggie. Just brought it up in case you had different intentions for it and forgot. I'm not concerned with it.
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Aligns with the See Other convention from #2536, picked up in the rebase onto main, so a Turbo form submission advances instead of re-rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🤖 suggested review level: 3 Read 📖 one-line status change on 6 create redirects + a request spec each
Fixes a Turbo bug where a successful create didn't advance the page: the record saved but the user stayed on the form, so re-clicking Save produced duplicate records.
createactions redirected with a plain 302, so Turbo didn't move on. Theupdateactions already used:see_other— this just alignscreateto match.status: :see_otherto the create-success redirect in community_news, stories, events, workshops, resources, video_recordings, each with a request spec asserting 303.Scope