2 ms·
After playing for some hours with the new Turbo on a side project (with Django as backend), it mostly works fine. One thing that is kind of broken out of the b
by danjac 6y ago
After playing for some hours with the new Turbo on a side project (with Django as backend), it mostly works fine.
One thing that is kind of broken out of the box is form submissions: so a common pattern with server side rendering is to re-render the form with validation errors, but otherwise redirect to wherever.
The workaround here I think is to use turbo-streams and just re-render the invalid form HTML snippet rather than the whole page. While this is probably ok for most cases, I have some forms (3rd party library stuff) where this is going to be more work than I'd like, and due to a bug in the beta release you can't override the default form submission behavior - Turbo throws an error if a form POST returns anything other than a redirect. So it's probably not quite ready for production yet.