diff options
author | Matthew Draper <matthew@trebex.net> | 2014-09-14 06:51:29 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-09-14 07:04:47 +0930 |
commit | 457c876b15640d79f4398c3facb8652210d7c2e0 (patch) | |
tree | 175196f9d8a4fea481de30b8fe0514e2ccc4535f /actionview/lib/action_view/helpers | |
parent | 75e06a197ffb493c7ce9edc1579c1fc8cb5381d7 (diff) | |
download | rails-457c876b15640d79f4398c3facb8652210d7c2e0.tar.gz rails-457c876b15640d79f4398c3facb8652210d7c2e0.tar.bz2 rails-457c876b15640d79f4398c3facb8652210d7c2e0.zip |
Revert "Merge pull request #15312 from JuanitoFatas/action_view/asset_path"
This reverts commit 21ec7fefea5a1b823cb88733b019b3d52240801d.
Per #16911, there's actually a good reason for a "blank" value to have a
useful `to_s` here. So let's also add some tests to prove that.
Diffstat (limited to 'actionview/lib/action_view/helpers')
-rw-r--r-- | actionview/lib/action_view/helpers/asset_url_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb index 9e8d005ec7..29733442c1 100644 --- a/actionview/lib/action_view/helpers/asset_url_helper.rb +++ b/actionview/lib/action_view/helpers/asset_url_helper.rb @@ -121,8 +121,8 @@ module ActionView # asset_path "application", type: :stylesheet # => /assets/application.css # asset_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js def asset_path(source, options = {}) - return "" unless source.present? source = source.to_s + return "" unless source.present? return source if source =~ URI_REGEXP tail, source = source[/([\?#].+)$/], source.sub(/([\?#].+)$/, '') |