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:
map.login '/login', :controller => 'sessions', :action => 'new'
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.resource :session
If you're not logged in, you're redirected to http://localhost:3000/session/new.
It makes some kind of sense, as the code in lib/authenticated_system.rb says redirect_to new_session_path
.
But I thought the routes mapping was supposed to work both ways (code to URL and URL to code). Can someone explain? Thanks