I am a bit confused why you are setting your session[:referer] to a route? usually you can just say redirect_to home_path. Is this an added feature?