imgix / imgix-rails

A gem for integrating imgix into Rails projects

Home Page:https://www.imgix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ix_picture_tag helper sets custom alt: attribute on the <picture> tag instead of <img> tag

amdixon opened this issue · comments

Rails' regular image_tag helper allows an optional alt: option to be passed in. However, in your helpers, notably the ix_picture_tag, the alt: option when passed in is applied to the <picture> tag rather than the <img> tag which is the HTML standard.

For example:

<%= ix_picture_tag(url,
  picture_tag_options: {
    alt: "Some custom alt text"
  }
) %>

will result in:

<picture alt="Some custom alt text">
  ...
  <img>
  ...
</picture>

Where the behavior should be (ideally):

<picture>
  ...
  <img alt="Some custom alt text">
  ...
</picture>