PiecesJustificative: add field to set it mandatory

small css to align the fields
This commit is contained in:
Simon Lehericey 2017-03-29 14:38:54 +02:00
parent a907b9c062
commit e49ea2d0e0
3 changed files with 37 additions and 29 deletions

View file

@ -0,0 +1,3 @@
.pieces_justificatives_fields {
.form-inline > .form-group { vertical-align: top; }
}

View file

@ -25,7 +25,7 @@ class Admin::PiecesJustificativesController < AdminController
def update_params def update_params
params params
.require(:procedure) .require(:procedure)
.permit(types_de_piece_justificative_attributes: [:libelle, :description, :id, :order_place, :lien_demarche]) .permit(types_de_piece_justificative_attributes: [:libelle, :description, :id, :order_place, :mandatory, :lien_demarche])
end end
def move_up def move_up

View file

@ -1,4 +1,5 @@
= f.fields_for :types_de_piece_justificative, types_de_piece_justificative, remote: true do |ff| .pieces_justificatives_fields
= f.fields_for :types_de_piece_justificative, types_de_piece_justificative, remote: true do |ff|
.form-inline .form-inline
.form-group .form-group
%h4 Libellé %h4 Libellé
@ -22,6 +23,10 @@
= ff.object.button_up(index: ff.index, url: move_up_admin_procedure_pieces_justificatives_path(@procedure, ff.index)) = ff.object.button_up(index: ff.index, url: move_up_admin_procedure_pieces_justificatives_path(@procedure, ff.index))
= ff.object.button_down(index: ff.index, url: move_down_admin_procedure_pieces_justificatives_path(@procedure, ff.index)) = ff.object.button_down(index: ff.index, url: move_down_admin_procedure_pieces_justificatives_path(@procedure, ff.index))
.form-group
%h4 Obligatoire ?
.center
= ff.check_box :mandatory
.form-group .form-group
%br &nbsp; %br &nbsp;