Add type_de_champ yes/no

This commit is contained in:
Xavier J 2016-07-12 15:25:26 +02:00
parent 7281ee74b2
commit 23e582d597
4 changed files with 17 additions and 1 deletions

View file

@ -44,6 +44,11 @@
@extend .col-lg-3;
}
.type_champ-yes_no {
@extend .col-md-3;
@extend .col-lg-3;
}
.type_champ-phone {
@extend .col-md-2;
@extend .col-lg-2;

View file

@ -9,7 +9,8 @@ class TypeDeChamp < ActiveRecord::Base
civilite: 'civilite',
email: 'email',
phone: 'phone',
address: 'address'
address: 'address',
yes_no: 'yes_no'
}
belongs_to :procedure

View file

@ -23,6 +23,9 @@
- elsif champ.type_champ == 'datetime'
=render partial: 'users/description/champs/datetime', locals: {champ: champ}
- elsif champ.type_champ == 'yes_no'
=render partial: 'users/description/champs/yes_no', locals: {champ: champ}
-else
%input.form-control{name:"champs['#{champ.id}']",
placeholder: champ.libelle,

View file

@ -0,0 +1,7 @@
%label.radio-inline
= radio_button_tag "champs['#{champ.id}']", "true", champ.value == 'true'
Oui
%label.radio-inline
= radio_button_tag "champs['#{champ.id}']", "false", champ.value == 'false'
Non