Getting a nil error when adding to a table using '<<' in the view
<p>So here's the setup:</p>

<p>The controller is passing these two to the view:</p>

<pre><code>@courses = Course.all
@assignments = Assignment.all
</code></pre>



<pre><code>&lt;% this_assignment = Assignment.create(instructor: "test") %&gt;
&lt;% @assignments &lt;&lt; this_assignment %&gt;
</code></pre>

<p>The Assignment model has (among others) the attribute <code>instructor</code> which is a string value.</p>

<p>I get the following error:</p>

<pre><code>undefined method `&lt;&lt;' for nil:NilClass
</code></pre>

<p>What's weird is I do the same thing for course earlier in the code and it seems to work fine. I'm sure it's some simple fix but I can't seem to figure out why <code>&lt;&lt;</code> works for <code>@courses</code> but not for <code>@assignments</code>.</p>