I have an array done in this way
[{"g"=>1, "f"=>"01"}, {"g"=>2, "f"=>"02"}, {"g"=>2, "f"=>"03"}, {"g"=>3, "f"=>"04"}, {"g"=>4, "f"=>"05"}, {"g"=>4, "f"=>"06"}]
and I have to split into groups with the same value of "g", like
[{"g"=>1, "f"=>"01"}],
[{"g"=>2, "f"=>"02"}, {"g"=>2, "f"=>"03"}],
[{"g"=>3, "f"=>"04"}],
[{"g"=>4, "f"=>"05"}, {"g"=>4, "f"=>"06"}]
I tried to a.map{|a| a['g']}.uniq to find all the unique "g" and then to use each function to the resulting array to apply a select to the first array, but produce no result. Some one knows how to divide the array in groups?