aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-03-12 08:41:45 +0100
committerYves Senn <yves.senn@gmail.com>2014-03-12 08:41:45 +0100
commit7bbdb076c09ea0b923d09e4671657adb3e1b4c69 (patch)
tree6bd44ed20136d03c16ad850dee7ad71d3b0cc45b /actionpack
parent7e21be3c29fc8b4a8edbf93b9cc06b9e9186bb4a (diff)
parent0d191baa823414a900ef7362359cb6fc87be1d38 (diff)
downloadrails-7bbdb076c09ea0b923d09e4671657adb3e1b4c69.tar.gz
rails-7bbdb076c09ea0b923d09e4671657adb3e1b4c69.tar.bz2
rails-7bbdb076c09ea0b923d09e4671657adb3e1b4c69.zip
Merge pull request #14291 from laurocaetano/doc-for-original-fullpath
Add documentation for original_fullpath. [ci skip]
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 1318c62fbe..daa06e96e6 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -152,6 +152,13 @@ module ActionDispatch
Http::Headers.new(@env)
end
+ # Returns a +String+ with the last requested path including their params.
+ #
+ # # get '/foo'
+ # request.original_fullpath # => '/foo'
+ #
+ # # get '/foo?bar'
+ # request.original_fullpath # => '/foo?bar'
def original_fullpath
@original_fullpath ||= (env["ORIGINAL_FULLPATH"] || fullpath)
end