My hash looks like below. I want the output to be in the same hash form but with hash arranged according to the price.
{
1=>{
"name"=>"Mark",
"date"=>"27/08/2015",
"bed"=>"3",
"furnish"=>"Fully",
"size"=>"10",
"price"=>790000
},
2=>{
"name"=>"Mark",
"date"=>"27/08/2015",
"bed"=>"3",
"furnish"=>"Fully",
"size"=>"10",
"price"=>720000
},
3=>{
"name"=>"Mark",
"date"=>"27/08/2015",
"bed"=>"3",
"furnish"=>"Fully",
"size"=>"10",
"price"=>750000
},
4=>{
"name"=>"Mark",
"date"=>"27/08/2015",
"bed"=>"3",
"furnish"=>"Fully",
"size"=>"10",
"price"=>710000
}
}
I've read from How to sort a Ruby Hash by number value? but it is just with one nested hash. Totally clueless with how I could achieve that. Would be grateful if any of you are willing to help me.