module ActiveStorage::Blob::Representable
def preview(transformations)
This method raises ActiveStorage::UnpreviewableError if no previewer accepts the receiving blob. To determine
<%= image_tag video.preview(resize_to_limit: [100, 100]) %>
how to use the built-in version:
Active Storage provides one, but you may want to create your own (for example, if you need authentication). Here’s
Avoid processing previews synchronously in views. Instead, link to a controller action that processes them on demand.
blob.preview(resize_to_limit: [100, 100]).processed.url
extracts the first frame from a video and the PDF previewer extracts the first page from a PDF document.
from a non-image blob. Active Storage comes with built-in previewers for videos and PDF documents. The video previewer
Returns an ActiveStorage::Preview instance with the set of +transformations+ provided. A preview is an image generated
def preview(transformations) if previewable? ActiveStorage::Preview.new(self, transformations) else raise ActiveStorage::UnpreviewableError end end