diff --git a/src/Turbo/doc/index.rst b/src/Turbo/doc/index.rst index 4618bd701c2..3dc8ed898d5 100644 --- a/src/Turbo/doc/index.rst +++ b/src/Turbo/doc/index.rst @@ -179,6 +179,26 @@ situation. ] ]); + +4. Flash Messages and forward-fetching side effects +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Of course, if you have side effects, like added `Flash Messages `_ +to your form submissions, they will be flushed during the asynchronous call. +To prevent such actions on form submissions to be executed ahead of time +(like emptying a FlashBag of session messages), the best way is +to simply disable Turbo Drive on submission inputs/buttons +(which are tried on hover by default). + +Simply add a ``data-turbo="false"`` attribute and value to your widgets: + +.. code-block:: html + + + +This way, only your real user manual action will trigger the form submission. +More information can be found in the Turbo documentation: https://turbo.hotwired.dev/reference/attributes. + More Turbo Drive Info ^^^^^^^^^^^^^^^^^^^^^