title: undefined method `user_path'
body: <p>I am trying to construct a users model manually (without using 'resources :users' in the routes.rb file). My routes.rb file looks like this:</p>
  
  <pre><code>match '/users/:id', :to =&gt; 'users#show'
  match '/all_users', :to =&gt; 'users#index'
  </code></pre>
  
  <p>This is my index method in the users controller:</p>
  
  <pre><code>def index
    @title = "All users"
    @users = User.paginate(:page =&gt; params[:page])
  end
  </code></pre>
  
  <p>This is my index view:</p>
  
  <pre><code>&lt;h1&gt;All users&lt;/h1&gt;
  &lt;%= will_paginate %&gt;
  &lt;ul class="users"&gt;
    &lt;% @users.each do |user| %&gt;
      &lt;li&gt;
        &lt;%= link_to user.email, user %&gt;
      &lt;/li&gt;
    &lt;% end %&gt;
  &lt;/ul&gt;
  &lt;%= will_paginate %&gt;
  </code></pre>
  
  <p>I get this error message when I hit localhost:3000/all_users:</p>
  
  <pre><code>undefined method `user_path'
  </code></pre>
  
  <p>I don't see where this is coming from.</p>
  
  <p>EDIT:</p>
  
  <p>Ok, I've discovered that changing 'user' to '@user' in the view makes it work:</p>
  
  <pre><code>&lt;%= link_to user.email, @user %&gt;
  </code></pre>
  
  <p>But I really don't understand the error message, or the real difference between 'user' and '@user'. Plus, clicking on the link created does not redirect to the user's page, it stays on localhost:3000/all_users.</p>