From c4276ddf3860128d4f64c795c8b5cf5258aaeab8 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 15 Oct 2012 13:30:24 -0500 Subject: Ignore asset url query string or anchor when appending extensions and computing public path --- actionpack/lib/action_view/helpers/asset_url_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/asset_url_helper.rb') 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 -- cgit v1.2.3