Dear all,
  I have a hash
serv_value => {60=>{"servicetype_id"=>4, "quantity"=>1, "amount"=>360.0,
"narration"=>"GTT"}, 6116=>{"servicetype_id"=>1934, "quantity"=>1,
"amount"=>42500.0, "narration"=>"HRT.BT SHUNT"},
78=>{"servicetype_id"=>5499, "quantity"=>1, "amount"=>500.0,
"narration"=>"LIPID PROFILE"}, 6477=>{"servicetype_id"=>5499,
"quantity"=>1, "amount"=>500.0, "narration"=>"XRAY CHARGES"},
152=>{"servicetype_id"=>5499, "quantity"=>1, "amount"=>90.0,
"narration"=>"VDRL"}}

I want it to rearrange such a way that I should get

serv_value => {4 => {"quantity"=>1, "amount"=>360.0,
"narration"=>"GTT"}, 1934=>{"quantity"=>1, "amount"=>42500.0,
"narration"=>"HRT.BT SHUNT"}, 5499 => {{ "quantity"=>1, "amount"=>500.0,
"narration"=>"LIPID PROFILE"}, {"quantity"=>1, "amount"=>500.0,
"narration"=>"XRAY CHARGES"}, {"quantity"=>1, "amount"=>90.0,
"narration"=>"VDRL"}} }

In this, I need to make a hash with key as servicetype_id.

Pls help me,
Thanks in Advance,
Avantec
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to