From 91e3aa194293e3211177922123e20d800e878d76 Mon Sep 17 00:00:00 2001 From: Derek Prior Date: Thu, 17 Dec 2015 20:57:42 -0500 Subject: [PATCH] Document when fallback_location is used [ci-skip] If you're not familiar with how the `Referer` header works, you likely won't understand why you need to provide a fallback or under what circumstances it would be used. Hopefully this clarifies things a bit. --- actionpack/lib/action_controller/metal/redirecting.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index aeecb48f85..513f0bc7e1 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -68,8 +68,14 @@ def redirect_to(options = {}, response_status = {}) #:doc: self.response_body = "You are being redirected." end - # Redirects the browser to the page that issued the request if possible, - # otherwise redirects to 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. + # + # 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. # # redirect_back fallback_location: { action: "show", id: 5 } # redirect_back fallback_location: post -- GitLab