Hi Colin, Thank you very much for your quick reply. I'm just sitting in front of the computer and thinking what to do , because I'm new to ruby and rails.
here is the explanation. x has zero or more records in the y table. and y belongs to x. hope this will help.x table id is name y table id is Itname. but both are reprecenting the same data. I appreciate if you can answer for this ASAP. Thanks. Colin Law wrote: > On 29 March 2010 11:33, Nipuna Weerasinghe <[email protected]> wrote: >> Hi, >> >> I have a controllers called x and y. I want to search and display "y" >> tables data using X's primary key, this key is a foreign key for Y. > > That does not make sense to me unless you mean that the id field in xs > table is the same as the id field in ys table. In that case why not > just combine the tables? > > Probably I do not understand exactly what you mean. Is so please give > the relationships between the models (has_many, belongs to etc) > > Colin -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

