diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-02 18:57:02 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-03-03 21:23:34 -0800 |
commit | 5e0a05b8cb236d285ebb45de006dd3600c69357d (patch) | |
tree | 8fd61eaaa83407c6880bd94c9c3d662cf5c28a84 /actionpack/lib/action_view | |
parent | bcfb77782b9d7f28f0c19005da909162e5e27690 (diff) | |
download | rails-5e0a05b8cb236d285ebb45de006dd3600c69357d.tar.gz rails-5e0a05b8cb236d285ebb45de006dd3600c69357d.tar.bz2 rails-5e0a05b8cb236d285ebb45de006dd3600c69357d.zip |
Tweak the semantic of various URL related methods of ActionDispatch::Request
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/url_helper.rb | 5 | ||||
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index d9607c0095..148f2868e9 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -544,10 +544,11 @@ module ActionView # submitted url doesn't have any either. This lets the function # work with things like ?order=asc if url_string.index("?") - request_uri = request.request_uri + request_uri = request.fullpath else - request_uri = request.request_uri.split('?').first + request_uri = request.path end + if url_string =~ /^\w+:\/\// url_string == "#{request.protocol}#{request.host_with_port}#{request_uri}" else diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index f639700eaf..12142a3728 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -34,6 +34,8 @@ module ActionView @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new + @request.env.delete('PATH_INFO') + @params = {} end end |