title: want to create an array of hashes with an array of items in Ruby
body: <p>I am having a hard time figuring out how to do this. I have a set of items returned from a where query. Each item belongs to a menu. I'd like to create an array called menus that has as it's items the name of the item's menu and then create a sub-array of items but I can't figure this out. </p>
  
  <p>I'd like (assuming "blue" and "red" are names of the menus):</p>
  
  <pre><code>  menus:["blue":
            {"items":["ocean","sky"]}],
           "red"  
            {"items":["fire","sunset"]}]
      ]
  </code></pre>
  
  <p>and items will have a belongs_to relationship to get to menu. I tried</p>
  
  <pre><code>menus=[]
  items.each do |mi|
    menus &lt;&lt; mi.menu.name
  end
  </code></pre>
  
  <p>but can't get this to work. Any ideas? I'm thinking I need to do a collect but nor sure.</p>
  
  <p>thx for any help</p>