module ActiveStorage::Blob::Representable

def variant(transformations)

variable, call ActiveStorage::Blob#variable?.
Raises ActiveStorage::InvariableError if ImageMagick cannot transform the blob. To determine whether a blob is

can then produce on-demand.
This will create a URL for that specific blob with that specific variant, which the ActiveStorage::RepresentationsController

<%= image_tag Current.user.avatar.variant(resize: "100x100") %>

specific variant that can be created by a controller on-demand. Like so:
Frequently, though, you don't actually want to transform the variant right away. But rather simply refer to a

Then it'll upload said variant to the service according to a derivative key of the blob and the transformations.
This will create and process a variant of the avatar blob that's constrained to a height and width of 100px.

avatar.variant(resize: "100x100").processed.service_url

files, and it allows any image to be transformed for size, colors, and the like. Example:
Returns an ActiveStorage::Variant instance with the set of +transformations+ provided. This is only relevant for image
def variant(transformations)
  if variable?
    ActiveStorage::Variant.new(self, transformations)
  else
    raise ActiveStorage::InvariableError
  end
end