I have a Member, User, and Address model, with the last two being child
tables to the first. When I create the models in irb, make the
relations and perform the save on the member, all three models are
inserted into the database with the proper relations. However when I do
the same in the controller, only the member is saved.
def create
@member = Member.new(params[:member])
@address = Address.new(params[:address])
@user = User.new(params[:user])
@member.address = @address
@member.user = @user
respond_to do |format|
if @member.save
...
The form is setup properly to allow the address and user data to be
extracted as shown above, ex:
<input id=“user_email” name=“user[email]” size=“30” type=“text”
value=“[email protected]” /
Is there something that I am missing here?
Thanks