diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-30 17:24:36 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-30 17:24:36 -0800 |
commit | eb5e6fe713756b36ee6df9b04f28cfb8bae60dbc (patch) | |
tree | bec8d290e2e5fd257f1180ec7169ce58ceea9d55 /actionpack/lib/action_controller/request.rb | |
parent | 4fabc9b2f376c47d4381572167956063b3c8c418 (diff) | |
download | rails-eb5e6fe713756b36ee6df9b04f28cfb8bae60dbc.tar.gz rails-eb5e6fe713756b36ee6df9b04f28cfb8bae60dbc.tar.bz2 rails-eb5e6fe713756b36ee6df9b04f28cfb8bae60dbc.zip |
Simplify Request#path
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 8 |
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 |