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.
Ian H. (Guest)
on 2006-01-12 22: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
matthew clark (Guest)
on 2006-01-13 00:04
(Received via mailing list)
try :part.part_name
This topic is locked and can not be replied to.