Method: ActiveStorage::Variant#url

Defined in:
activestorage/app/models/active_storage/variant.rb

#url(expires_in: ActiveStorage.service_urls_expire_in, disposition: :inline) ⇒ Object

Returns the URL of the blob variant on the service. See Blob#url for details.

Use url_for(variant) (or the implied form, like link_to variant or redirect_to variant) to get the stable URL for a variant that points to the ActiveStorage::RepresentationsController, which in turn will use this service_call method for its redirection.



82
83
84
# File 'activestorage/app/models/active_storage/variant.rb', line 82

def url(expires_in: ActiveStorage.service_urls_expire_in, disposition: :inline)
  service.url key, expires_in: expires_in, disposition: disposition, filename: filename, content_type: content_type
end