| Class | ActionController::Request |
| In: |
lib/23.rb
|
| Parent: | Object |
Need to modify the request slightly
| request_uri | -> | old_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
# File lib/23.rb, line 62
62: def request_uri
63: uri = old_request_uri
64: if ActionController::check_mode_and_base
65: uri = BASE_URL + uri unless uri.include?(BASE_URL)
66: end
67: uri
68: end