On Tue, Aug 11, 2009 at 12:03 PM, Sijo Kg <rails-mailing-l...@andreas-s.net>wrote:
> > Hi > you get agencies for each contract like > > Contract.all.each { |c| c.agencies } > > Here you get each contract information too For example > > Contract.all.each do |c| > c.name #contract name > c.agencies > end Hi Sijo Thank you In the below code Contract.all.each do |c| c.name #contract name c.agencies end i am not able to get c.agencies.name I have name in agencies table but i am not able to help me Plz -- Karthik.k Mobile - +91-9894991640 > > Can collect it to an array like > > array = [] > Contract.all.each do |c| > array << [c,c.agencies] > end > and can iterate the array now > > > Sijo > -- > 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 -~----------~----~----~----~------~----~------~--~---