On a rails 2.3.8 site I have login links on each page (that takes a user to a separate signin page). After a successful login the user is currently redirected to root. Inste
Instead of trying to redirect to the referrer, I would set the session[:return_to]
You'll need a before filter that runs before your authentication on all your actions:
def store_return_to session[:return_to] = request.url end
Then change your redirect to just be
redirect_back_or_default()