demarches-normaliennes/app
Pierre de La Morinerie 0800bf68d0 views: allow unselecting all values from a multiple dropdown
Currently, deselecting all values from a multiple dropdown rendered as
checkboxes doesn't have any effect when submitting the form (the
previous values are still there, instead of being deselected).

This is because unchecked checkboxes are not sent by the browser – so
the "empty selection" never gets sent.

Rails `form.check_box` usually works around this by inserting an empty
hidden checkbox element, that will be sent even if all others are
de-selected. But the documentation warns that this is not possible when
iterating over an array (rather than a model). Which is our case here.

To fix this, this commit uses `collection_check_boxes` instead. It will
insert the proper hidden checkboxes in all cases, and fix our use case.

See https://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-collection_check_boxes
2020-08-27 11:13:40 +02:00
..
assets views: add a "None" option to optional radio lists 2020-08-25 11:42:30 +02:00
controllers Internationalization of the Contact page in FR and EN 2020-08-27 11:03:34 +02:00
dashboards define SHOW_PAGE_ATTRIBUTES for bill dashboard 2020-07-07 08:06:37 +00:00
fields manager: remove support for old pj 2019-07-30 16:11:17 +02:00
graphql graphql: possibility to filter dossiers by archived 2020-07-29 16:59:34 +02:00
helpers helpers: remove element immediately when no timeout is specified 2020-08-25 15:45:49 +02:00
javascript autosave: trigger an autosave after removing a row 2020-08-25 15:45:49 +02:00
jobs jobs: add health-related keywords to dubious procedures scanner 2020-08-25 12:04:10 +00:00
lib Internationalization of the Contact page in FR and EN 2020-08-27 11:03:34 +02:00
mailers ajout du nom d'application dans les mailers 2020-07-23 16:17:52 +02:00
models validates phone champ server side 2020-08-20 15:33:03 +02:00
policies policies: clarify the role of ChampPolicy 2020-06-24 15:42:30 +02:00
serializers expose effectif_annuel dans api graphql 2020-04-23 09:53:27 +02:00
services services: make etablissement save raise on error 2020-08-18 14:56:40 +02:00
validators validate api_entreprise_token 2020-07-08 18:59:22 +02:00
views views: allow unselecting all values from a multiple dropdown 2020-08-27 11:13:40 +02:00