# Form Entity Names for Child Objects

**URL:** <https://www.ruby-forum.com/t/form-entity-names-for-child-objects/52330>\
**Category:** Rails\
**Created:** [January 12, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/form-entity-names-for-child-objects/52330 "2006-01-12T21:42:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [January 12, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/form-entity-names-for-child-objects/52330/1 "2006-01-12T21:42:44Z")

</div>

In my controller, I do this to instantiate and populate my Part,  
PartName and PartNumber objects.

def edit  
@part = Part.find(params[:id], :include =\> [:part\_name,  
:part\_number])  
end

But in the view, this doesn’t refer to the right object. I somehow  
need to indicate that the part\_name object is a child of the part  
object.

\<%= text\_field\_with\_auto\_complete :part\_name, :part\_name%\>

If I instantiate the part\_name object separately it works but I  
thought I didn’t have to do that.

- Ian

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [January 12, 2006, 11:04pm UTC](https://www.ruby-forum.com/t/form-entity-names-for-child-objects/52330/2 "2006-01-12T23:04:38Z")

</div>

try :part.part\_name
