app/controllers/admin/work_sites_controller.rb
def redirect_back(fallback_location: root_url, **args)
      referer = request.headers['Referer']
      if referer
        redirect_to referer, **args
      else
        redirect_to fallback_location, **args
      end
    end
##
# Redirects the browser to the page that issued the request (the referrer)
# if possible, otherwise redirects to the provided default fallback
# location.
#
# The referrer information is pulled from the HTTP `Referer` (sic) header on
# the request. This is an optional header and its presence on the request is
# subject to browser security settings and user preferences. If the request
# is missing this header, the `fallback_location` will be used.
#
# Note: This functionality is included in Rails 5, so this method can be
#       removed.
#
Redirects the browser to the page that issued the request (the referrer)
if possible, otherwise redirects to the provided default fallback
location.

The referrer information is pulled from the HTTP `Referer` (sic) header on
the request. This is an optional header and its presence on the request is
subject to browser security settings and user preferences. If the request
is missing this header, the `fallback_location` will be used.

This functionality is included in Rails 5, so this method can be
removed.
Redirects the browser to the page that issued the request ( the referrer ) if possible otherwise redirects to the provided default fallback location . The referrer information is pulled from the HTTP ` Referer ` ( sic ) header on the request . This is an optional header and its presence on the request is subject to browser security settings and user preferences . If the request is missing this header the ` fallback_location ` will be used . This functionality is included in Rails 5 so this method can be removed .
def redirect_back(fallback_location: root_url, **args)
      referer = request.headers['Referer']
      if referer
        redirect_to referer, **args
      else
        redirect_to fallback_location, **args
      end
    end
def redirect_back ( fallback_location : root_url , ** args ) referer = request . headers [ 'Referer' ] if referer redirect_to referer , ** args else redirect_to fallback_location , ** args end end
Redirects the browser to the page that issued the request (the referrer)
if possible, otherwise redirects to the provided default fallback
location.
Redirects the browser to the page that issued the request ( the referrer ) if possible otherwise redirects to the provided default fallback location .
fallback_location
root_url
args