Feed 2 tables with one Form


hi all,

i have a form with several datas given by the user : name, adress , tel
When the user press “create” i call an action called “create_stagiaire”
which create his account but i also want to feed another table named
“demandes” where which i feed with a date given by the user. In my form
this date field is writen like this :
<%= date_select ‘demande’, ‘dr’%>

No problem and here is the action :

def create_stagiaire
@stagiaire = Stagiaire.new(params[:stagiaire])
if @stagiaire.save
flash[:notice] = ‘Stagiaire was successfully created.’
redirect_to :action => ‘list’
render :action => ‘new’

My probleme is that, it creates an entry in the “stagiaires” table with
no problem, but not in the “demandes” table :frowning:

here the error : Mysql::Error: #23000Column ‘dr’ cannot be null: INSERT
INTO demandes (dr, type, stagiaire_id) VALUES(NULL, ‘’, 13)

i supposed that i did something wrong near :
@stagiaire.demandes.create(params[:dr]) thks


wouldn’t it be: