title: Organisation of routes in Rails -- restful_authentication, session and /login
body: <p>I am struggling with the route setup for a Rails application. I have installed restful_authentication and mostly followed the instructions. I have set up the routes this way:</p>
  
  <pre><code>map.login '/login', :controller =&gt; 'sessions', :action =&gt; 'new'
  map.logout '/logout', :controller =&gt; 'sessions', :action =&gt; 'destroy'
  map.resource :session
  </code></pre>
  
  <p>If you're not logged in, you're redirected to <a href="http://localhost:3000/session/new" rel="nofollow noreferrer">http://localhost:3000/session/new</a>.
  It  makes some kind of sense, as the code in lib/authenticated_system.rb says <code>redirect_to new_session_path</code>.</p>
  
  <p>But I thought the routes mapping was supposed to work both ways (code to URL and URL to code). Can someone explain? Thanks</p>