demarches-normaliennes/app/views/shared
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
..
attachment creation of attachment_upload_helpers and integration in the code 2020-07-29 12:26:27 +02:00
champs Put IGN map behind a feature flag 2020-07-30 17:22:28 +02:00
dossiers views: allow unselecting all values from a multiple dropdown 2020-08-27 11:13:40 +02:00
help help_dropdown_procedure contains now a <button> and not a <div>, which makes it accessible for keyboard navigation 2020-06-18 11:17:39 +02:00
password Administrateur password, remove one level of indirection 2019-08-12 13:43:03 +02:00
_france_connect_login.html.haml ajout de traductions 2020-07-29 09:27:16 +02:00
_mailer_round_button.html.haml helpers: add variants to mailer_round_button 2019-07-25 12:25:50 +02:00
_mailer_vertical_margin.html.haml helpers: add vertical_margin helper for mailers 2019-07-25 12:25:50 +02:00
_procedure_description.html.haml change procedure_auto_archive helper name and added a helper for 23 h 59 2020-05-28 13:22:02 +00:00
_tab_item.html.haml views: add tab_item and active_tab_item helpers 2018-08-16 16:36:37 +02:00