Forum: Ruby on Rails image content-type question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joe Van D. (Guest)
on 2006-04-28 21:47
(Received via mailing list)
If I want to check that someone has uploaded a standard image, would
simply doing

class Image
  def validate
      errors.add(:content_type, "must be an image") unless
content_type and content_type.include?("image")
  end
end

So, basically checking to make sure that the content type of the image
contains "image".  Will that backfire at any point?  I suppose I could
check for "image/jpeg" or "image/gif" or whatever.
This topic is locked and can not be replied to.