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:
parent
50f61ee37b
commit
4bba1f0660
3 changed files with 110 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue