refactor(dossier): use champ id as champ attributes key
This commit is contained in:
parent
1126099e0b
commit
b94bc8fd8a
4 changed files with 34 additions and 10 deletions
|
@ -35,10 +35,9 @@
|
|||
dossier.procedure.groupe_instructeurs.order(:label).map { |gi| [gi.label, gi.id] },
|
||||
{ include_blank: dossier.brouillon? }
|
||||
|
||||
= f.fields_for :champs, dossier.champs do |champ_form|
|
||||
- champ = champ_form.object
|
||||
= render partial: "shared/dossiers/editable_champs/editable_champ",
|
||||
locals: { champ: champ, form: champ_form }
|
||||
- dossier.champs.each do |champ|
|
||||
= fields_for champ.input_name, champ do |form|
|
||||
= render partial: "shared/dossiers/editable_champs/editable_champ", locals: { form: form, champ: champ }
|
||||
|
||||
- if !dossier.for_procedure_preview?
|
||||
.dossier-edit-sticky-footer
|
||||
|
|
|
@ -8,5 +8,6 @@
|
|||
= render partial: 'shared/dossiers/editable_champs/champ_label', locals: { form: form, champ: champ, seen_at: defined?(seen_at) ? seen_at : nil }
|
||||
- if champ.type_champ == "titre_identite"
|
||||
%p.notice Carte nationale d’identité (uniquement le recto), passeport, titre de séjour ou autre justificatif d’identité. Formats acceptés : jpg/png
|
||||
= render partial: "shared/dossiers/editable_champs/#{champ.type_champ}",
|
||||
locals: { champ: champ, form: form }
|
||||
|
||||
= form.hidden_field :id, value: champ.id
|
||||
= render partial: "shared/dossiers/editable_champs/#{champ.type_champ}", locals: { form: form, champ: champ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue