0

How to do you manually reganerate a variant with active storage? Example class:

  class Doc
    has_many_attached :uploads do |attachable|
      attachable.variant :pdf_thumb, resize_to_limit: [400, nil]
    end
  end

I want to be able force the regeneration of the pdf_thumb from the example

Jake McAllister
  • 1,037
  • 3
  • 12
  • 29
  • https://edgeapi.rubyonrails.org/classes/ActiveStorage/Blob/Representable.html#method-i-representation : "Frequently, though, you don’t actually want to transform the variant right away. But rather simply refer to a specific variant that can be created by a controller on-demand. Like so: `<%= image_tag Current.user.avatar.variant(resize_to_limit: [100, 100]) %>` " ... does that work the way you want? – Jad Jun 06 '23 at 15:40
  • No the variant already exists, I want to regenerate the specific variant image that's hosted on S3. I basically want to know how to do it manually – Jake McAllister Jun 09 '23 at 11:00
  • https://stackoverflow.com/questions/52389104/can-you-remove-a-variant-from-activestorage – Jad Jun 13 '23 at 10:21

0 Answers0