I have an Attachment model, which is using Paperclip to handle uploaded files. The file can be anything an image, a txt, doc, pdf, rar, zip, tar etc.
I want to create thumbnails only if the file uploaded is an image.
How to create thumbnails in Paperclip conditionally based upon file content_type
I have an Attachment model, which is using Paperclip to handle uploaded files. The
Share
This is a nice solution:
You can also use the image? method in your views to either render an image_tag, or something else…