diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-15 11:48:38 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-15 11:48:38 -0700 |
commit | 4f4417314c9f1e81bc7a11b569d85ace1f8384f8 (patch) | |
tree | 034e2e8bfe15d9586b002dfba6fc2d8425957d64 /actionpack/lib | |
parent | dc126cfd6f664f92b5a522bd98fbf39ff474785f (diff) | |
parent | c4276ddf3860128d4f64c795c8b5cf5258aaeab8 (diff) | |
download | rails-4f4417314c9f1e81bc7a11b569d85ace1f8384f8.tar.gz rails-4f4417314c9f1e81bc7a11b569d85ace1f8384f8.tar.bz2 rails-4f4417314c9f1e81bc7a11b569d85ace1f8384f8.zip |
Merge pull request #7956 from josh/ignore-asset-url-query-or-anchor
Ignore asset url query string or anchor when generating path
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_url_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_url_helper.rb b/actionpack/lib/action_view/helpers/asset_url_helper.rb index d75e4c0edc..0bb5e739bb 100644 --- a/actionpack/lib/action_view/helpers/asset_url_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_url_helper.rb @@ -122,6 +122,8 @@ module ActionView return "" unless source.present? return source if source =~ URI_REGEXP + tail, source = source[/([\?#].+)$/], source.sub(/([\?#].+)$/, '') + if extname = compute_asset_extname(source, options) source = "#{source}#{extname}" end @@ -140,7 +142,7 @@ module ActionView source = "#{host}#{source}" end - source + "#{source}#{tail}" end alias_method :path_to_asset, :asset_path # aliased to avoid conflicts with a asset_path named route |