title: Opinion on whether to use a hash or an array, pushing new element in Rails
body: <p>I'm working on a Rails 3 app where a user's profile <code>has_many :todos</code>. The user has three categories of <code>:todos</code>: two that are added to by clicking buttons on other pages, and one that they can add to themselves (through a status-update-like form).</p>
  
  <p>So I'm interested in your thoughts on:</p>
  
  <ol>
  <li>How to best set it up, particularly whether to use arrays or hashes. I'd like to count all of the <code>:todos</code> as well as list the string values for the individual categories. </li>
  <li>The best way to push to the two categories that aren't like status updates. I'd attach the push to a button most likely, so the push would come on click or something.</li>
  </ol>
  
  <p><strong>UPDATE:</strong> Just to check...</p>
  
  <p>The Profile Model:</p>
  
  <pre><code>has_many :todo, :through =&gt; :profiles_todos
  has_many :profiles_todos
  </code></pre>
  
  <p>The ProfilesTodos Model:</p>
  
  <pre><code>belongs_to :profile
  belongs_to :todo
  </code></pre>
  
  <p>And the <code>profiles_todos</code> Migration:</p>
  
  <pre><code>(in self.up)
    t.string :category 
    t.integer :profile_id 
    t.integer :todo_id
  </code></pre>