Forum: Ruby on Rails Newbie Model Question

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.
Nicktabs (Guest)
on 2009-04-15 22:31
(Received via mailing list)
I'm building a shop in rails as a learning excercise. I've got to the
last part when I'm sending out e-mail order confirmations. The e-mails
contain a list of each line item the customer ordered, I also want to
display the catgory name the customer ordered from.

The database is setup: Category > Product > Line_item.
So I want to navigate back from line_item > product > category so i
can display the category name in the email however im not sure how I
tell it to find the category name from the item.

Be greatful for anyhelp.
Philip H. (Guest)
on 2009-04-15 23:03
(Received via mailing list)
On Apr 15, 2009, at 10:09 AM, Nicktabs wrote:

> Be greatful for anyhelp.

Assuming all the associations are setup correctly.

You can also set it up using :through so that you can just to

This topic is locked and can not be replied to.