Forum: Ruby on Rails image content-type question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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")

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.