refresh list of pj when adding new one

This commit is contained in:
Tanguy PATTE 2015-11-20 14:17:38 +01:00
parent bcf712828e
commit bd5dc1e35a
5 changed files with 38 additions and 23 deletions

View file

@ -1,16 +1,7 @@
= form_for [:admin, @procedure], url: admin_procedure_pieces_justificatives_path(@procedure) , remote: true do |f|
#liste_piece_justificative
= render partial: 'fields', locals:{ types_de_piece_justificative: @procedure.types_de_piece_justificative, f: f }
%hr
= f.fields_for :types_de_piece_justificative, types_de_piece_justificative do |ff|
.form-inline
.form-group
%h4 Libellé
=ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé'
.form-group
%h4 Description
=ff.text_area :description, class: 'form-control description', placeholder: 'Description'
-if ff.object.id.nil?
.form-group#add_type_de_piece_justificative_button
%br  
= f.submit('Ajouter la pièce')
#new_type_de_piece_justificative
= render partial: 'fields', locals:{ types_de_piece_justificative: TypeDePieceJustificative.new, f: f }