aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-11-30 17:24:36 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-30 17:24:36 -0800
commiteb5e6fe713756b36ee6df9b04f28cfb8bae60dbc (patch)
treebec8d290e2e5fd257f1180ec7169ce58ceea9d55
parent4fabc9b2f376c47d4381572167956063b3c8c418 (diff)
downloadrails-eb5e6fe713756b36ee6df9b04f28cfb8bae60dbc.tar.gz
rails-eb5e6fe713756b36ee6df9b04f28cfb8bae60dbc.tar.bz2
rails-eb5e6fe713756b36ee6df9b04f28cfb8bae60dbc.zip
Simplify Request#path
-rwxr-xr-xactionpack/lib/action_controller/request.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index 78a57acf6f..baa955cb04 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -369,11 +369,9 @@ EOM
# Returns the interpreted \path to requested resource after all the installation
# directory of this application was taken into account.
def path
- path = (uri = request_uri) ? uri.split('?').first.to_s : ''
-
- # Cut off the path to the installation directory if given
- path.sub!(%r/^#{ActionController::Base.relative_url_root}/, '')
- path || ''
+ path = request_uri.to_s[/\A[^\?]*/]
+ path.sub!(/\A#{ActionController::Base.relative_url_root}/, '')
+ path
end
memoize :path