Forum: Ruby on Rails Restful paths for rails - when error occurs

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dhana (Guest)
on 2009-03-08 21:35
(Received via mailing list)
I have a question specific question on rails when error happens.  I
have a SessionsController that takes care of the user logging in and
logging out using the restful actions "new" and "destroy".  Since I
want the path to be user friendly, I mapped the resource to this

map.login "/login", :controller => "sessions", :action => "new"
map.logout "/logout", :controller => "sessions", :action => "destroy"

The resources above works fine for the two paths.  But what I've
noticed is when errors occur (when the action is being rendered).
Then in that case, instead of the path on the browser that say /login,
it would say /session.  Is there a way to override it. The page works
fine, but I just don't like how the url changes.  I also got this same
issue with scaffolded resources.  For example, when I purposefully
triggered errors in a "products/new" action, the path on the address
bar changes to /products, but the new form is still there.

Any way to avoid this?
This topic is locked and can not be replied to.