From: Aldric Giacomoni Date: 2010-03-23T03:40:59+09:00 Subject: Re: Sorting keys of hash based on value Riccardo Cecolin wrote: >> > Do you want keys or the whole hash? > > irb(main):015:0> hash.keys.sort { |a,b| hash[b][:happy] <=> > hash[a][:happy] } > => [:c, :a, :b] Of course.. I was trying to make it too complicated. Thanks! -- Posted via http://www.ruby-forum.com/.