Another newbie question I fear but help as always appreciated.

I have a tools table and a controls table and for each 'tool' I allow
user to specify upto 3 controls.

So the Tools table is :-
id
desc
control_id1
control_id2
control_id3

and the Controls table is:
id
controldesc

I have linked the tables in their models with
Tools
 belongs_to :control

and Control
 has_many :tools

When I display the Tools rows I want to display the 'desc' column from
the Controls table for each of the control_id1, control_id2 and
control_id3.

Is this possible or is a relationship link only available on a single
column in the Tools table that must be called 'control_id'  ?

Hope this makes sense.

Thanks
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to