Forum: Ruby on Rails Reading and saving data with belongs_to and has_many

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jack W Jennings (Guest)
on 2007-08-02 23:25
(Received via mailing list)
Hi all, I'm new to Ruby on Rails, and so I have a question that's
probably simple, but I can't figure it out.

I'm trying to create several models that all belong_to a master model,
say "entries", which has_one of the others. The other tables
("destinations", "people", "entrydates") all have the entry_id row.

How would one reference each row that matches the in a loop
(i.e. display the entry and the "destination", "person", and
"entrydate" that matches)?

Also, how would one save the data to each of these tables in one

All of the code that I've written has been lengthy and ugly (and also
doesn't really work), and I can only imagine that there has to be a
concise way to do this...
This topic is locked and can not be replied to.