# Default routes do not seem to be working

**URL:** <https://www.ruby-forum.com/t/default-routes-do-not-seem-to-be-working/127380>\
**Category:** Rails\
**Created:** [January 28, 2008, 8:12pm UTC](https://www.ruby-forum.com/t/default-routes-do-not-seem-to-be-working/127380 "2008-01-28T20:12:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [January 28, 2008, 8:12pm UTC](https://www.ruby-forum.com/t/default-routes-do-not-seem-to-be-working/127380/1 "2008-01-28T20:12:19Z")

</div>

i don’t know if something has changed or if there is something i have  
just overlooked.  
i set up the restful authentication plugin and all works fine except  
for the fact that when i go to a page that requires authentication, i  
am not redirected to /sessions/new instead of /login.

here is what i have in my routes file:

map.login ‘/login’, :controller =\> ‘sessions’, :action =\> ‘new’  
map.logout ‘/logout’, :controller =\> ‘sessions’, :action =\>  
‘destroy’

map.resource :session

when i run rake routes, login and logout are at the top. is there  
something that was changed in the way routes are found now? before it  
would always use whatever was higher.

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [January 28, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/default-routes-do-not-seem-to-be-working/127380/2 "2008-01-28T20:27:10Z")

</div>

ok, i see that in the plugin a line was changed in the  
authenticated\_system.rb to use new\_session\_path instead of :controller  
=\> ‘sessions’, :actions =\> ‘new’

i guess for some reason i thought that even when using restful routes,  
it would still match any custom named routes first. is that not true?
