Add gender on individual form
This commit is contained in:
parent
0418968f77
commit
8ade790a81
4 changed files with 13 additions and 2 deletions
|
@ -132,7 +132,7 @@ class Users::DossiersController < UsersController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_params
|
def update_params
|
||||||
params.require(:dossier).permit(:id, :autorisation_donnees, individual_attributes: [:nom, :prenom, :birthdate])
|
params.require(:dossier).permit(:id, :autorisation_donnees, individual_attributes: [:gender, :nom, :prenom, :birthdate])
|
||||||
end
|
end
|
||||||
|
|
||||||
def checked_autorisation_donnees?
|
def checked_autorisation_donnees?
|
||||||
|
|
|
@ -13,6 +13,11 @@
|
||||||
= f.hidden_field :id
|
= f.hidden_field :id
|
||||||
|
|
||||||
= f.fields_for :individual, @facade.individual do |ff|
|
= f.fields_for :individual, @facade.individual do |ff|
|
||||||
|
.form-group
|
||||||
|
%label
|
||||||
|
%h4
|
||||||
|
Civilité
|
||||||
|
= ff.select :gender, ['Monsieur', 'Madame']
|
||||||
.form-group
|
.form-group
|
||||||
%label
|
%label
|
||||||
%h4
|
%h4
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddGenderInIndividualTable < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :individuals, :gender, :string
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20161005144657) do
|
ActiveRecord::Schema.define(version: 20161006085422) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -218,6 +218,7 @@ ActiveRecord::Schema.define(version: 20161005144657) do
|
||||||
t.string "prenom"
|
t.string "prenom"
|
||||||
t.string "birthdate"
|
t.string "birthdate"
|
||||||
t.integer "dossier_id"
|
t.integer "dossier_id"
|
||||||
|
t.string "gender"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "invites", force: :cascade do |t|
|
create_table "invites", force: :cascade do |t|
|
||||||
|
|
Loading…
Reference in a new issue