Skip to content

Make preload_link_tag work with images#43088

Merged
byroot merged 1 commit intorails:mainfrom
nateberkopec:preload-images
Aug 24, 2021
Merged

Make preload_link_tag work with images#43088
byroot merged 1 commit intorails:mainfrom
nateberkopec:preload-images

Conversation

@nateberkopec
Copy link
Contributor

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.

@nateberkopec
Copy link
Contributor Author

nateberkopec commented Aug 24, 2021

This PR is an abstraction/general case of #42892.

@ghiculescu ghiculescu added the ready PRs ready to merge label Aug 24, 2021
@byroot
Copy link
Member

byroot commented Aug 24, 2021

Could you add a changelog entry for this? Other than that LGTM, I'd be happy to merge.

@nateberkopec
Copy link
Contributor Author

nateberkopec commented Aug 24, 2021

@byroot Donezo.

EDIT: accidental close/reopen lol

@byroot
Copy link
Member

byroot commented Aug 24, 2021

Hum, lot's of failures on CI, but you just got unlucky.

Thanks!

@byroot byroot merged commit c7647f8 into rails:main Aug 24, 2021
kaspth pushed a commit that referenced this pull request Aug 24, 2021
Make preload_link_tag work with images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actionview ready PRs ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants