aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorJuanito Fatas <katehuang0320@gmail.com>2014-05-25 16:18:51 +0800
committerJuanito Fatas <katehuang0320@gmail.com>2014-05-25 16:18:51 +0800
commitd28ed9f5360b54320b2d1baaa2e6d0e3f3f941fc (patch)
treed91a8215521e32e2eafeb967f48b4591040d46e6 /actionview/lib
parentf632f79b8dcd144408c66a544984b2ba9cf52f87 (diff)
downloadrails-d28ed9f5360b54320b2d1baaa2e6d0e3f3f941fc.tar.gz
rails-d28ed9f5360b54320b2d1baaa2e6d0e3f3f941fc.tar.bz2
rails-d28ed9f5360b54320b2d1baaa2e6d0e3f3f941fc.zip
Convert source to string if it is present.
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb2
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(/([\?#].+)$/, '')