demarches-normaliennes/app/controllers/users
Pierre de La Morinerie 96037069ff autosave: remove the repetition row after deletion
Before, when autosaving a draft, removing a repetition row would
send `_destroy` inputs to the controller – but not remove the row
from the DOM. This led to the `_destroy` inputs being sent again
on the next autosave request, which made the controller raise
(because the row fields were already deleted before).

To fix this, we let the controller response remove the deleted
row(s) from the DOM.

Doing it using a controller response avoids the need to keep track
of operations on the Javascript side: the controller can easily
know which row was just deleted, and emit the relevant changes for
the DOM. This keeps the autosave requests robust: even if a request
is skipped (e.g. because of a network interruption), the next request
will still contain the relevant informations to succeed, and not let the
form in an unstable state.

Fix #5470
2020-08-25 14:39:34 +02:00
..
activate_controller.rb ActivateController: add tests and clean a bit 2019-08-16 11:22:36 +02:00
commencer_controller.rb generation d'un fichier pdf bien nommé 2020-03-17 15:00:03 +01:00
confirmations_controller.rb mailers: add procedure context to the confirmation link 2020-02-25 11:45:36 +00:00
demarches_controller.rb Add Style/CollectionMethods to rubocop 2019-09-12 14:48:18 +02:00
dossiers_controller.rb autosave: remove the repetition row after deletion 2020-08-25 14:39:34 +02:00
feedbacks_controller.rb app: rename new_user to users 2019-03-25 10:56:39 +01:00
passwords_controller.rb admin: replace calls to Administrateur.find_by(email: ...) 2020-02-04 16:21:42 +01:00
profil_controller.rb [link to #4557] An instructeur cannot change its email on its own 2019-12-11 17:18:21 +01:00
registrations_controller.rb mailers: add procedure context to the confirmation link 2020-02-25 11:45:36 +00:00
sessions_controller.rb [fix #4238] When the token does not exist, redirect to home page without sending a new link 2019-08-27 15:01:46 +02:00
user_controller.rb app: rename new_user to users 2019-03-25 10:56:39 +01:00