Reputation: 1975
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
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