diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-05-25 17:16:05 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-05-25 17:16:05 +0200 |
commit | 21ec7fefea5a1b823cb88733b019b3d52240801d (patch) | |
tree | 2aaa850201c7169ce6b605e0a5268b0ed3698716 | |
parent | 2bb6b51c01719c3d558bf8cc962c812a5497f2b2 (diff) | |
parent | d28ed9f5360b54320b2d1baaa2e6d0e3f3f941fc (diff) | |
download | rails-21ec7fefea5a1b823cb88733b019b3d52240801d.tar.gz rails-21ec7fefea5a1b823cb88733b019b3d52240801d.tar.bz2 rails-21ec7fefea5a1b823cb88733b019b3d52240801d.zip |
Merge pull request #15312 from JuanitoFatas/action_view/asset_path
Convert source to string if it is present.
-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 ae684af87b..2b009ba961 100644 --- a/actionview/lib/action_view/helpers/asset_url_helper.rb +++ b/actionview/lib/action_view/helpers/asset_url_helper.rb @@ -118,8 +118,8 @@ module ActionView # asset_path "application", type: :stylesheet # => /stylesheets/application.css # asset_path "http://www.example.com/js/xmlhr.js" # => http://www.example.com/js/xmlhr.js def asset_path(source, options = {}) - source = source.to_s return "" unless source.present? + source = source.to_s return source if source =~ URI_REGEXP tail, source = source[/([\?#].+)$/], source.sub(/([\?#].+)$/, '') |