Skip to content

Image, asset and currency filters ​

Last updated View as Markdown
  • With image_url, you get the URL of an image at the width and height you give, with an optional crop.
  • With image_tag, a srcset is added from the width of the URL or from widths. The alt attribute is always added. Set width, height or srcset to nil to remove it. All attribute values are escaped.
  • With inline_asset_content, the content of a .svg, .js or .css asset smaller than 15 KB is printed.
  • With money_with_currency, the price is printed with the currency code, for example $10 USD.
  • When the value is not a number, nothing is printed by money. A missing text or URL is accepted by link_to.
  • You can pass a color object to color_brightness and brightness_difference.
  • Filters on the lines after the first line inside {{ }} are now applied.

Last updated: