Save Champs value since description page

This commit is contained in:
Xavier J 2015-11-03 16:16:39 +01:00
parent 27dbd3a878
commit 6fbe735793
3 changed files with 29 additions and 1 deletions

View file

@ -31,6 +31,11 @@ class Users::DescriptionController < UsersController
cerfa.save
end
@dossier.champs.each do |champ|
champ.value = params[:champs]["'#{champ.id}'"]
champ.save
end
@dossier.pieces_justificatives.each do |piece_justificative|
unless params["piece_justificative_#{piece_justificative.type}"].nil?
piece_justificative.content = params["piece_justificative_#{piece_justificative.type}"]

View file

@ -22,7 +22,7 @@
= champ.libelle
-if champ.type_champs == 'textarea'
%textarea.form-control{name:"champs[#{champ.id}]",
%textarea.form-control{name:"champs['#{champ.id}']",
placeholder: champ.libelle,
id: "champs_#{champ.id}"}
=champ.value