views:

9

answers:

1

So Authlogic ships with some pretty confusingly (for an end user) named routes. For example, instead of /login/new, you get /user_session/new, and so on. Then, when a user can't login, the error message appears as "This user session could not be saved."

It's a small thing, but that's just kind of... ugly, to me. What's a graceful way to rename the default session routes to something more meaningful (and easier to type)?

BTW, we are totally invested in Authlogic, so replacing it is a no-go

A: 

Rails lets you rename routes to your hearts desire. Assuming you're using Rails 2.x, the following routes should do the trick:

map.login, 'login', :controller =>'user_sessions', :action => 'new'
map.logout, 'logout', :controller => 'user_sessions', :action => 'destroy'
map.signup, 'signup', :controller => 'users', :action => 'new'

You can call them by using the following:

login_path
logout_path
signup_path
vegetables