TableA: TableB: TableC:
------- ------- -------
TableB_ID User_ID User_ID
User_Name
TableB_ID is a foreign key to TableB, User_ID in TableB and TableC is
foreign key to a table that play no role hier.
now I would like to display the User_Name field found in TableC in a e.g
index view. So I need to go from TableA with the TableB_ID foreign key
to get the User_ID field from TableB, then search for the record in
TableC that has this User_ID as one of its fields and get the User_Name.
This should look something like:
<td><%= TableA.TableB.TableC(where TableB.User_ID ==
TableC.User_ID).User_Name %></td>
I know that the syntax above is not correct but just to show what I'm
looking for.
Hope I made my self clear ;-)
Thanks
Dani
<td><%= course_attendee.sys_title.name unless
course_attendee.sys_title.nil? %></td>
--
Posted via http://www.ruby-forum.com/.
It might even be better to start with the one on ActiveRecord Associations
http://guides.rubyonrails.org/association_basics.html
Colin