-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to disable turbo for form or optin to forms.
In large application upgrading from turbolinks to turbo requires all forms that use `render` to return validations errors needs to be updated with `status: :unprocessable_entity` to as in 4670f2b to. This makes it hard to upgrade as you ether have to have a single PR that upgrades all form (when you have over 400 forms is pretty risky) or disable all forms which again can be risky if you miss one before completing the upgrade. There are options but it would be great if you can could do this in turbo and save hours of work. To allow this I've added a `formMode` to the session so you can change the behaviour of turbo and how it interacts with forms. The mode is set via the `Tubro.setFormMode` option and can be set to one of 3 options: - "on" all forms will be submitted with turbo, this is the default - "off" forms will not be submitted with turbo - "optin" forms by default will not be submitted with turbo unless the form is annotated with `data-turbo="true"` attribute. Adding these options will allow user of turbo to decide how forms should work and make upgrading easier.
- Loading branch information
1 parent
ce9cbff
commit 4b738d4
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters