I'm having a problem with redirect_to :back
. Yes, it's referrers.
I often get the exception
(ActionController::RedirectBackError) "No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called successfully. If this is a test, make sure to specify request.env[\"HTTP_REFERER\"]."
I realize that this is a result of a referrer not being available. Is there a way that, for example, one can set a session variable on each access with the last page visited, and, when HTTP_REFERER is not available, utilize this session variable to redirect to?
Maybe it's late but I would like to share my method which also preserve options:
You can use it like: