2

Make preload_link_tag work with images by nateberkopec · Pull Request #43088 · r...

 2 years ago
source link: https://github.com/rails/rails/pull/43088
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Copy link

Contributor

nateberkopec commented 6 days ago

Prior to this change, preload_link_tag with an image would generate a tag without an as attribute. If the as attribute doesn't get set, browsers tend to ignore the link tag (confirmed in Chrome), making the tag useless.

This change fixes the issue.

After a quick look at the valid values for as in a preload tag, I don't think there are any other ones missing that could be detected from the file's mime type or extension.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK