Before using paperclip with rails, I wrote my own upload script with which I uploaded a batch of images and assigned to their respective objects. But now i need to switch all the images to be paperclip friendly.
Is there a way to pass images to paperclip without using a form?
Image.all.each do |image|
image[:file] = image.filename
image.save
end
something along the lines where i can iterate through a list of Image objects and reassign the image file as a paperclip attachment. Thanks.
Given
fileis the name of your paperclip object, I’d do something like: