Specify location in Attacher.derivatives_processor

Hi,

I’m generating some versions of an image (thumb, large and original), this is my code:

class CustomImageUploader < Uploader
  plugin :derivatives

  Attacher.derivatives_processor do |original|
    magick = ImageProcessing::MiniMagick.source(original)

    {
      thumb: magick.resize_to_limit!(220, 220),
      large: magick.resize_to_limit!(800, 600),
    }
  end
end

This works very well, but I want to specify a location for each version. For example, thumb images should be saved in “images/thumb_images/name_of_image.jpg”.

How can I do that?

Hi, see the Location section in the Getting Started guide.