From: Nicolas 2b Date: 2010-03-28T06:01:01+09:00 Subject: Help to get value from abject inside an array Hi, My problem use RoR object but is ruby oriented so I post here. I got an array with lot of objects (type 'Product') like this (only 4 here) : [#, #, #, #] What I want to do is iterate on the array and for each company_id, know how much products have the same company_id. I get the company_id like this : products.collect(&company_id).uniq but after I don't know how to get an array like this : [1 => 22, 2 => 15, 3 => 9] Thanks for your help --- Nicolas -- Posted via http://www.ruby-forum.com/.