Add gender on individual form

This commit is contained in:
Xavier J 2016-10-06 11:21:07 +02:00
parent 0418968f77
commit 8ade790a81
4 changed files with 13 additions and 2 deletions

View file

@ -132,7 +132,7 @@ class Users::DossiersController < UsersController
end
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
def checked_autorisation_donnees?

View file

@ -13,6 +13,11 @@
= f.hidden_field :id
= f.fields_for :individual, @facade.individual do |ff|
.form-group
%label
%h4
Civilité
= ff.select :gender, ['Monsieur', 'Madame']
.form-group
%label
%h4

View file

@ -0,0 +1,5 @@
class AddGenderInIndividualTable < ActiveRecord::Migration
def change
add_column :individuals, :gender, :string
end
end

View file

@ -11,7 +11,7 @@
#
# 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
enable_extension "plpgsql"
@ -218,6 +218,7 @@ ActiveRecord::Schema.define(version: 20161005144657) do
t.string "prenom"
t.string "birthdate"
t.integer "dossier_id"
t.string "gender"
end
create_table "invites", force: :cascade do |t|