Class ActionController::AbstractRequest
In: lib/123.rb
lib/20.rb
Parent: Object

Need to modify the request slightly

Methods

External Aliases

request_uri -> old_request_uri

Public Instance methods

old_request_uri()

Alias for request_uri

Request_uri usually returns the path relative to the root of the application. However, if you try to do redirect_to(request_uri) then you may get unexpected results. This method overwrites request_uri to always include the full front-facing path. This also breaks route recognition, so this is addressed in ActionController::Routing::RouteSet::recognize_path

[Source]

    # File lib/123.rb, line 58
58:                 def request_uri
59:                   uri = old_request_uri
60:                   if ActionController::check_mode_and_base
61:                         uri = BASE_URL + uri unless uri.include?(BASE_URL)
62:                   end
63:                   uri
64:             end

Request_uri usually returns the path relative to the root of the application. However, if you try to do redirect_to(request_uri) then you may get unexpected results. This method overwrites request_uri to always include the full front-facing path. This also breaks route recognition, so this is addressed in ActionController::Routing::RouteSet::recognize_path

[Source]

    # File lib/20.rb, line 61
61:                 def request_uri
62:                   uri = old_request_uri
63:                   if ActionController::check_mode_and_base
64:                     uri = BASE_URL + uri unless uri.include?(BASE_URL)
65:                   end
66:                   uri
67:             end

[Validate]