1
0
Fork 0
forked from OpenNeo/impress

Use higher-res outfit thumbnails if the device has at least 2x DPI

This commit is contained in:
Emi Matchu 2024-02-08 10:07:09 -08:00
parent 5d0848bf28
commit 66f20747a9
2 changed files with 8 additions and 1 deletions

View file

@ -48,6 +48,13 @@ module OutfitsHelper
content_tag :li, :class => class_name, &block
end
def outfit_image_tag(outfit)
image_tag(
outfit.image.small.url,
srcset: [[outfit.image.medium.url, "2x"]],
)
end
def pet_attribute_select(name, collection, value=nil)
options = options_from_collection_for_select(collection, :id, :human_name, value)
select_tag name, options, id: nil, class: name

View file

@ -1,6 +1,6 @@
= outfit_li_for(outfit) do
- if outfit.image?
= link_to image_tag(outfit.image.small.url), outfit
= link_to outfit_image_tag(outfit), outfit
%header
.outfit-star