title: Rails - Sort Hash of Hashes based on subhash value
body: <p>I have the following hash:</p>
  
  <pre><code>h = { "people"=&gt;
          { "joe"   =&gt; { "score" =&gt; 3, "favorite_food" =&gt; "pizza"}, 
            "marry" =&gt; { "score" =&gt; 89, "favorite_food" =&gt; "ice_cream" }
           }
       }
  </code></pre>
  
  <p>How do I sort this hash based on score (and keep it sorted)? </p>
  
  <p>ie: the result would be:</p>
  
  <pre><code>    { "people"=&gt;
          { 
            "marry" =&gt; { "score" =&gt; 89, "favorite_food" =&gt; "ice_cream" }
            "joe"   =&gt; { "score" =&gt; 3, "favorite_food" =&gt; "pizza"}, 
           }
       }
  </code></pre>