Inc1982
Inc1982

Reputation: 1975

What is the status of the request.referer method?

I'm just started working on a rails legacy app (2.3.5) and it has some code:

@req = request.referer

I checked some docs: http://apidock.com/rails/ActionController/AbstractRequest/referer and it says that the last stable version for this was 2.2.1. Even though it says the same for the 'referrer' method.. I debugged it the request object says that it has both of these methods available to it.

Why do these methods work for me.. when the docs say they've been deprecated?

Upvotes: 2

Views: 542

Answers (1)

Peter Brown
Peter Brown

Reputation: 51707

When Rails moved to Rack in version 2.3.0 it started depending on Rack for this type of info. You can see in this commit that ActionController::Request began to inherit from Rack::Request. The referrer method is still available because it's coming from Rack::Request and will never actually go away unless Rack changes and removes it.

Upvotes: 2

Related Questions