Understanding ActiveStorage Variants for Image Transformations in Rails

Image transformations let you show images in the size or format you need. You can create a new version by calling variant on an attachment and passing the desired transformations. When a browser requests that URL, Rails will process the original image on demand and redirect to the generated file.