Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make preload_link_tag work with images #43088

Merged
merged 1 commit into from Aug 24, 2021
Merged

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.

None yet

3 participants