Add type_de_champ yes/no
This commit is contained in:
parent
7281ee74b2
commit
23e582d597
4 changed files with 17 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
7
app/views/users/description/champs/_yes_no.html.haml
Normal file
7
app/views/users/description/champs/_yes_no.html.haml
Normal 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
|
Loading…
Reference in a new issue