title: Ruby - Adding on to a Multidimensional Array
body: <p>I would like to loop through a process and add an object to my Database each time, but if it is not added properly I would like to collect the errors in a multidimensional array.  One array would keep which Lot it was that had the error and the second array will have the error message.</p>
  
  <p>Here is my declaration:</p>
  
  <pre><code>errors = [[],[]]
  </code></pre>
  
  <p>So I would like the array to be formatted like this:</p>
  
  <pre><code>[[lot_count, "#{attribute}: #{error_message}" ]]
  </code></pre>
  
  <p>Which should look like this after looping:</p>
  
  <pre><code>[[1, "Name: Can not be blank" ],[1, "Description: Can not be blank" ],[2, "Name: Can not be blank" ]]
  </code></pre>
  
  <p>My problem is that it wont add it to the array. I'm not sure if the syntax is different for a multidimensional array.</p>
  
  <p>This gives me nothing in my array </p>
  
  <pre><code>errors.push([[lot_count, "#{attribute}: #{error_message}" ]])
  </code></pre>
  
  <p>This also gives me nothing in my array</p>
  
  <pre><code>errors += [[lot_count, "#{attribute}: #{error_message}" ]]
  </code></pre>