Do not crash with champ repetable with no children
This commit is contained in:
parent
f5c80f211d
commit
a708b071dd
1 changed files with 10 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
||||||
- champs = champ.rows.last
|
- champs = champ.rows.last
|
||||||
- index = (champ.rows.size - 1) * champs.size
|
- if champs.present?
|
||||||
%div{ class: "row row-#{champs.first.row}" }
|
- index = (champ.rows.size - 1) * champs.size
|
||||||
|
%div{ class: "row row-#{champs.first.row}" }
|
||||||
- champs.each.with_index(index) do |champ, index|
|
- champs.each.with_index(index) do |champ, index|
|
||||||
= fields_for "#{attribute}[#{index}]", champ do |form|
|
= fields_for "#{attribute}[#{index}]", champ do |form|
|
||||||
= render partial: "shared/dossiers/editable_champs/editable_champ", locals: { champ: champ, form: form }
|
= render partial: "shared/dossiers/editable_champs/editable_champ", locals: { champ: champ, form: form }
|
||||||
|
|
Loading…
Reference in a new issue