title: How do you sort an array of objects?
body: <p>I have an object as follows:</p>
  
  <pre><code>[{:id=&gt;2, :fname=&gt;"Ron", :lname=&gt;"XXXXX", :photo=&gt;"XXX"}, {:id=&gt;3, :fname=&gt;"Dain", :lname=&gt;"XXXX", :photo=&gt;"XXXXXXX"}, {:id=&gt;1, :fname=&gt;"Bob", :lname=&gt;"XXXXXX", :photo=&gt;"XXXX"}] 
  </code></pre>
  
  <p>I want to sort this by fname, alphabetically case insensitive so it would result in</p>
  
  <p>id: 1,3,2</p>
  
  <p>How can I sort this? I'm trying:</p>
  
  <pre><code>@people.sort! { |x,y| y[:fname] &lt;=&gt; x[:fname] }
  </code></pre>
  
  <p>But that has no effect.</p>