POST working with prefill query example for repeating fields

This commit is contained in:
Damien Le Thiec 2023-01-31 14:54:23 +01:00
parent 81df033282
commit 20ba96ba3c
10 changed files with 76 additions and 10 deletions

View file

@ -7,7 +7,7 @@ module DossierPrefillableConcern
return unless champs_public_attributes.any?
attr = { prefilled: true }
attr[:champs_public_all_attributes] = champs_public_attributes.map { |h| h.merge(prefilled: true) }
attr[:champs_public_all_attributes] = champs_public_attributes.compact.map { |h| h.merge(prefilled: true) }
assign_attributes(attr)
save(validate: false)