Pass params to Rails redirect_back
Since Rails 5, the golden standard for redirecting the browser to the page that
issued the request, has been ActionController::Redirecting#redirect_back
.
Unfortunately redirect_back
doesn’t allow you to modify in any way the
URL provided by referer header.
If you need to add query parameters or fragments, you have to write your own solution. This is the implementation I’m currently using: