Hi Karthik

  For example consider this

data_array = []
Contract.all.each do |c|
 data_array << [c,c.agencies]
end

    Now in view you can iterate thru this like

data_array.each do |arr|
 puts arr[0].name
 arr[1].each do |sub_arr|
  puts sub_arr.name
 end
end

        You can modify this according to your needs May be there some 
other easier methods


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
-~----------~----~----~----~------~----~------~--~---

Reply via email to