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?