Jean-Philippe
unread,Dec 31, 2008, 5:26:48 AM12/31/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Paperclip Plugin
Hello,
First, thanks for this plugin and the constant updates to it !
A feature I'd like to see in paperclip is a set of mime types,
matching some types of file.
Here is an example of the typical use case (as I don't think i'm
really clear):
class User < ActiveRecord::Base
has_attached_file :avatar
validates_attachment_content_type :avatar, :content_type => :image
end
or something along
validates_attachment_content_type :avatar, :content_type =>
Paperclip::MimeTypes::Image
with Paperclip::MimeTypes::Image being == ['image/jpeg', 'image/
pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg']
Other 'sets' of mime types being 'video', 'document' (Word, OO.org,
PDF etc) for exemple.
I think this could be a nice way to avoid duplication and missing mime
types.
Could this be added in some way in paperclip ?
Thanks (and happy new year :-) )