demarches-normaliennes/app/views/shared/dossiers/editable_champs/_repetition.html.haml
2019-02-07 12:29:27 +01:00

13 lines
697 B
Text

%div{ class: "repetition-#{form.index}" }
- champ.rows.each do |champs|
%div{ class: "row row-#{champs.first.row}" }
- champs.each do |champ|
= form.fields_for :champs, champ do |form|
= render partial: 'shared/dossiers/editable_champs/editable_champ', locals: { champ: form.object, form: form }
= form.hidden_field :_destroy, disabled: true
- if champ.persisted?
%button.button.danger.remove-row
Supprimer
- if champ.persisted?
= link_to "Ajouter une ligne pour « #{champ.libelle} »", champs_repetition_path(form.index), class: 'button add-row', data: { remote: true, method: 'POST', params: { champ_id: champ&.id }.to_query }