hotwired / turbo-site

turbo.hotwired.dev web site
82 stars 101 forks source link

Document redirecting to a new page on form submission #45

Open boardfish opened 3 years ago

boardfish commented 3 years ago

@DaveSanders suggested that @nwjlyons' and my solution to hotwired/turbo#138 should be documented here. I figured I'd raise an issue before I pick up a PR, because this does introduce a Stimulus code example to the Turbo docs. I'm not sure whether a solution to this problem should be built into hotwired/turbo first. There's a solution in the works for Turbo alone, but I'm not sure whether that'll definitely go ahead.

DaveSanders commented 3 years ago

Ah good point. I hadn't considered that. Maybe this issue is good enough for the time being until things settle.

TastyPi commented 2 years ago

I've created an example repo which includes a redirect to a new page and updating the form on errors https://github.com/TastyPi/turbo-forms. If the Turbo maintainers think this is a good pattern I'd be happy for it to be included in the Turbo docs.