diff --git a/app/helpers/outfits_helper.rb b/app/helpers/outfits_helper.rb index d3cd1fc6..732e4581 100644 --- a/app/helpers/outfits_helper.rb +++ b/app/helpers/outfits_helper.rb @@ -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 diff --git a/app/views/outfits/_outfit.html.haml b/app/views/outfits/_outfit.html.haml index 3734e284..13656983 100644 --- a/app/views/outfits/_outfit.html.haml +++ b/app/views/outfits/_outfit.html.haml @@ -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