add other option for dropdown select

This commit is contained in:
kara Diaby 2021-10-21 16:03:13 +02:00
parent 0e65916e44
commit c2fcd3992d
2 changed files with 15 additions and 5 deletions

View file

@ -22,7 +22,11 @@
- else
= form.select :value,
champ.options,
disabled: champ.disabled_options,
required: champ.mandatory?
champ.drop_down_other? ? champ.options.concat(["Autre"]) : champ.options,
{ selected: champ.other_value_present? ? "Autre" : champ.value,
required: champ.mandatory? },
{ class: champ.drop_down_other? ? "select_drop_down_other" : ""}
- if champ.drop_down_other?
.notice.drop_down_other_select_notice{ style: "#{champ.other_value_present? ? "display:block" : "display:none"}" }
= render partial: "shared/dossiers/drop_down_other_input", locals: { champ: champ, class_name: "text_field_drop_down_other_select" }