title: undefined method "each" rails 4.0
body: <p>I am an error in my view:</p>
  
  <pre><code>undefined method `each' for nil:NilClass
  &lt;tbody&gt;
     &lt;% @invoices.each do |invoice| %&gt;
       &lt;tr&gt;
         &lt;td&gt;&lt;%= invoice.invoiceDate%&gt;&lt;/td&gt;
         &lt;td&gt;&lt;%= invoice.invoiceNumber %&gt;&lt;/td&gt;
  </code></pre>
  
  <p>Here is my invoice controller index:</p>
  
  <pre><code>def index
      @invoices = Invoice.all
  end
  </code></pre>
  
  <p>Most posts I've seen about this error are because <code>@invoices</code> isn't declared correctly, unlike mine. Anyone have any ideas what else might be wrong??</p>
  
  <p>Thanks!!</p>