In my users photo album page they see photos they have uploaded and each photo has a \'make default\' link on it. When the user clicks make default, then the id of
make default
In Rails 5 it was introduced the function:
redirect_back(fallback_location: root_path)
It does redirect back whenever the HTTP_REFERER is known. Otherwise it redirects to the fallback_location.
HTTP_REFERER
fallback_location
The redirect_to :back is deprecated and will be removed from Rails 5.1.
redirect_to :back