# Build\_\* not working despite being has\_one

**URL:** <https://www.ruby-forum.com/t/build-not-working-despite-being-has-one/183755>\
**Category:** Rails\
**Created:** [February 19, 2010, 2:45pm UTC](https://www.ruby-forum.com/t/build-not-working-despite-being-has-one/183755 "2010-02-19T14:45:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [February 19, 2010, 2:45pm UTC](https://www.ruby-forum.com/t/build-not-working-despite-being-has-one/183755/1 "2010-02-19T14:45:01Z")

</div>

Hey all,

My intention here is just to create a corresponding contact when a user  
signs up, but the said contact is never created, despite using build\_\*  
with a has\_one:

User model:  
belongs\_to :contact

Users Controller:

def signup  
@user = User.new  
end

def signup\_success  
@user = User.find params[:id]  
@user.build\_contact  
end

protected

Any ideas why it doesn’t create a corresponding contact? Thanks for any  
response.

---

<div class="post-metadata">

**Author:** ![jmaenpaa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Post date:** [February 19, 2010, 3:43pm UTC](https://www.ruby-forum.com/t/build-not-working-despite-being-has-one/183755/2 "2010-02-19T15:43:22Z")

</div>

On Feb 19, 1:45 pm, John M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> def signup\_success  
> @user = User.find params[:id]  
> @user.build\_contact  
> end
> 
> protected
> 
> Any ideas why it doesn’t create a corresponding contact? Thanks for any  
> response.

Doesn’t look like you save the contact at any point.

Fred
