title: undefined method `each' for nil:NilClass - Rails
body: <p>I getting a nil class error. I understand exactly what this error is telling me but I don't know why it's nil. It seems to me that there should be an object getting passed to my table. This should be easy to debug. Here is my code for clarity.</p>
  
  <p>CONTROLLER METHOD:</p>
  
  <pre><code>def info
    @subscriber = Subscriber.find_by_phone_number(params[:phone_number])
  end
  </code></pre>
  
  <p>VIEW: </p>
  
  <pre><code> &lt;% @subscriber.each do |subscriber| %&gt;
    &lt;tr&gt;
     &lt;td&gt;&lt;%= image_tag avatar_url(subscriber) %&gt;&lt;/td&gt;
    &lt;/tr&gt;
   &lt;% end %&gt;
  </code></pre>
  
  <p>ERROR: </p>
  
  <pre><code> Showing /Users/intern/Desktop/Rails/rowster/app/views/subscribers/info.html.erb where line #3 raised:
   undefined method `each' for nil:NilClass
  </code></pre>
  
  <p>Binding on info method:</p>
  
  <pre><code>[1] pry(#&lt;SubscribersController&gt;)&gt; @subscriber
   =&gt; nil
  </code></pre>
  
  <p>let me know if you need anymore info?</p>