I have to create 300px widht thumbnails if the file is a picture ('image/jpeg', 'image/png', 'image/gif') and no thumbnails if the file has an other extension. I'm using Paperclip for file-upload (it's working great without the conditions...).
:file is the uploaded file and if it is an image, Paperclip should create a medium version of it.
class Paperplanes < ActiveRecord::Base
if validates_attachment_content_type :file, :content_type => ['image/jpeg', 'image/png', 'image/gif']
has_attached_file :file, :styles => { :medium => "x300>" }
else
has_attached_file :file
end
end
But this doesn't seem to work. Hope you guys can find a solution. THX!