instance method
url
Ruby on Rails 6.1.7.10
Since v6.1.7.10Signature
url(**options)
Returns the URL of the preview’s variant on the service. Raises ActiveStorage::Preview::UnprocessedError if the preview has not been processed yet.
This method synchronously processes a variant of the preview image, so do not call it in views. Instead, generate a stable URL that redirects to the URL returned by this method.
Parameters
-
optionskeyrest
Source
# File activestorage/app/models/active_storage/preview.rb, line 61
def url(**options)
if processed?
variant.url(**options)
else
raise UnprocessedError
end
end
Defined in activestorage/app/models/active_storage/preview.rb line 61
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Preview