instance method
service_url
Ruby on Rails 5.2.8.1
Since v5.2.8.1 Last seen in v6.1.7.10Signature
service_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 short-lived URL returned by this method.
Parameters
-
optionskeyrest
Source
# File activestorage/app/models/active_storage/preview.rb, line 60
def service_url(**options)
if processed?
variant.service_url(options)
else
raise UnprocessedError
end
end
Defined in activestorage/app/models/active_storage/preview.rb line 60
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Preview