Array of hashes

Hi
Newbie how to display the following output?

[{ "id" => "1", "value"=>"usa", "label"=>"country"},
{ "id" => "2""value"=>"india", "label"=>"country"},
{ "id" => "1""value"=>"chicago", "label"=>"city"},
{ "id" => "2", "value"=>"delhi", "label"=>"city"}]

output

id |city | country

···

--------------------
  1 |chicago| usa
  2 | delhi | india

arti

--
Posted via http://www.ruby-forum.com/.

We're here to help, but please do your own homework.

···

On Apr 1, 2012, at 15:58 , artificialman Vamshi wrote:

Hi
Newbie how to display the following output?

[{ "id" => "1", "value"=>"usa", "label"=>"country"},
{ "id" => "2""value"=>"india", "label"=>"country"},
{ "id" => "1""value"=>"chicago", "label"=>"city"},
{ "id" => "2", "value"=>"delhi", "label"=>"city"}]

output

id |city | country
--------------------
1 |chicago| usa
2 | delhi | india

Thank you Ryan.. I got the solution.

arti

···

--
Posted via http://www.ruby-forum.com/.