title: Getting undefined method `each` on my controller
body: <p>I have a method like this :</p>
  
  <pre><code>class ProfilesController &lt; ApplicationController
    before_filter :authenticate_user!
  
    current_user
  
    def index
      @users = User.all
    end
    ...
  end
  </code></pre>
  
  <p>and my route is</p>
  
  <pre><code>match 'profile',  :controller =&gt; 'profiles', :action =&gt; 'index'
  </code></pre>
  
  <p>but when I access <code>http://127.0.0.1:8080/profile</code> I get:</p>
  
  <blockquote>
    <p><code>NoMethodError</code> in <code>Profiles#index</code> undefined method <code>each</code> for <code>nil:NilClass</code></p>
  </blockquote>