instance method url

Ruby on Rails 7.0.10

Since v6.1.7.10

Available in: v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

url(expires_in: ActiveStorage.service_urls_expire_in, disposition: :inline)

Returns the URL of the blob variant on the service. See {ActiveStorage::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.

Parameters

expires_in key = ActiveStorage.service_urls_expire_in
disposition key = :inline
Source
# File activestorage/app/models/active_storage/variant.rb, line 80
  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

Defined in activestorage/app/models/active_storage/variant.rb line 80 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveStorage::Variant

Type at least 2 characters to search.

↑↓ navigate · open · esc close