I currently have a login popup in my header bar which is on every page in my website. I want to be able to reload the current page that the person is on after a successful
Rails 5 introduced alternative function:
redirect_back(fallback_location: root_path)
It redirect back whenever the HTTP_REFERER is known. Otherwise it redirects to the fallback_location.
The redirect_to :back
is deprecated in Rails 5.0 https://github.com/rails/rails/pull/22506 and removed since Rails 5.1