views: add a "None" option to optional radio lists

After clicking on a radio button option, it is impossible to revert to
the "None of the values selected" state.

However on non-mandatory fields, reverting to the no-selection value
should be possible.

To fix this, add an explicit "N/A" option.
This commit is contained in:
Pierre de La Morinerie 2020-08-19 15:27:57 +00:00
parent 50f61ee37b
commit 4bba1f0660
3 changed files with 110 additions and 0 deletions

View file

@ -5,6 +5,11 @@
%label
= form.radio_button :value, option
= option
- if !champ.mandatory?
%label.blank-radio
= form.radio_button :value, ''
Non renseigné
- else
= form.select :value,
champ.options,