# Model relations are not being made in controller

**URL:** <https://www.ruby-forum.com/t/model-relations-are-not-being-made-in-controller/119569>\
**Category:** Rails\
**Created:** [November 8, 2007, 12:41am UTC](https://www.ruby-forum.com/t/model-relations-are-not-being-made-in-controller/119569 "2007-11-08T00:41:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [November 8, 2007, 12:41am UTC](https://www.ruby-forum.com/t/model-relations-are-not-being-made-in-controller/119569/1 "2007-11-08T00:41:40Z")

</div>

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=“removed\_email\_address@domain.invalid” /

Is there something that I am missing here?

Thanks
