# Using form\_for for nested objects

**URL:** <https://www.ruby-forum.com/t/using-form-for-for-nested-objects/104989>\
**Category:** Deployment\
**Created:** [May 24, 2007, 5:22pm UTC](https://www.ruby-forum.com/t/using-form-for-for-nested-objects/104989 "2007-05-24T17:22:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerome\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@Jerome\_D](https://www.ruby-forum.com/u/Jerome_D)\
**Post date:** [May 24, 2007, 5:22pm UTC](https://www.ruby-forum.com/t/using-form-for-for-nested-objects/104989/1 "2007-05-24T17:22:07Z")

</div>

Hi,

I have the following data model:

- Person (name, …)
- Address (street, city)
- Person has\_ony Address

I would like to edit the Person and its Address in one single form.  
Using form\_for, I can add the person fields. Using fields\_for, I could  
have the Address also, but it’s not nested here (aka  
person[address[street]]. So the question is how to “prefix” the  
field\_for to include the Address hash into the Person hash?

Thank you!

---

<div class="post-metadata">

**Author:** ![Jerome\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@Jerome\_D](https://www.ruby-forum.com/u/Jerome_D)\
**Post date:** [May 24, 2007, 8:33pm UTC](https://www.ruby-forum.com/t/using-form-for-for-nested-objects/104989/2 "2007-05-24T20:33:56Z")

</div>

Hi Jerome,

I think you’ll get more help with this on the development list at  
removed\_email\_address@domain.invalid. The question doesn’t seem to me to  
be  
deployment related.

Best regards,  
Bill

----- Original Message -----  
From: “Jerome D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, May 24, 2007 10:22 AM  
Subject: [Rails-deploy] Using form\_for for nested objects
