title: Ruby array of hash. group_by and modify in one line
body: <p>I have an array of hashes, something like </p>
  
  <pre><code>[ {:type=&gt;"Meat", :name=&gt;"one"}, 
    {:type=&gt;"Meat", :name=&gt;"two"}, 
    {:type=&gt;"Fruit", :name=&gt;"four"} ]
  </code></pre>
  
  <p>and I want to convert it to this</p>
  
  <pre><code>{ "Meat" =&gt; ["one", "two"], "Fruit" =&gt; ["Four"]}
  </code></pre>
  
  <p>I tried <code>group_by</code> but then i got this </p>
  
  <pre><code>{ "Meat" =&gt; [{:type=&gt;"Meat", :name=&gt;"one"}, {:type=&gt;"Meat", :name=&gt;"two"}],
    "Fruit" =&gt; [{:type=&gt;"Fruit", :name=&gt;"four"}] }
  </code></pre>
  
  <p>and then I can't modify it to leave just the name and not the full hash. I need to do this in one line because is for a <code>grouped_options_for_select</code> on a Rails form.</p>