Skip to content

Commit

Permalink
Make AssetTagHelper#preload_link_tag to use path_to_asset method inst…
Browse files Browse the repository at this point in the history
…ead of asset_path.

To avoid conflicts with an asset_path named route.

Closes #42545
  • Loading branch information
nashby committed Jun 23, 2021
1 parent 97b494f commit c69f6b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -317,7 +317,7 @@ def favicon_link_tag(source = "favicon.ico", options = {})
# # => <link rel="preload" href="/media/audio.ogg" as="audio" type="audio/ogg" />
#
def preload_link_tag(source, options = {})
href = asset_path(source, skip_pipeline: options.delete(:skip_pipeline))
href = path_to_asset(source, skip_pipeline: options.delete(:skip_pipeline))
extname = File.extname(source).downcase.delete(".")
mime_type = options.delete(:type) || Template::Types[extname]&.to_s
as_type = options.delete(:as) || resolve_link_as(extname, mime_type)
Expand Down

0 comments on commit c69f6b1

Please sign in to comment.