Forum: Ruby on Rails Form Entity Names for Child Objects

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8ed6d55dddf47e0974bac833f08e4390?d=identicon&s=25 Ian Harding (Guest)
on 2006-01-12 21:42
(Received via mailing list)
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
69b2ef4bce76b5b27c94e898976dc6d8?d=identicon&s=25 matthew clark (Guest)
on 2006-01-12 23:04
(Received via mailing list)
try :part.part_name
This topic is locked and can not be replied to.