class ActiveStorage::Attachment
def variant(transformations)
Raises an +ArgumentError+ if +transformations+ is a +Symbol+ which is an
See ActiveStorage::Blob::Representable#variant for more information.
avatar.variant(:thumb).processed.url
or if you are using pre-defined variants:
avatar.variant(resize_to_limit: [100, 100]).processed.url
Example:
instance for the attachment with the set of +transformations+ provided.
Returns an ActiveStorage::Variant or ActiveStorage::VariantWithRecord
def variant(transformations) transformations = transformations_by_name(transformations) blob.variant(transformations) end