`srcset` в Rails `image_tag` helper

image_tag("icon.png",
           srcset: { 'pic_640.jpg' => '640w',
                     'pic_1024.jpg' => '1024w',
                     'pic_1980.jpg' => '1980w' },
           sizes: '100vw',
           class: 'my-image')
<img src="/assets/ants_1980.jpg"
     srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w"
     sizes="100vw"
     class="my-image">

Ссылки

https://github.com/rails/rails/pull/29349

Редактировать