Created
March 25, 2010 10:54
-
-
Save simonrentzke/343418 to your computer and use it in GitHub Desktop.
content types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_content | |
case self.content_type | |
when "video/mpeg", "video/quicktime", "video/x-msvideo", 'video/x-ms-wmv', 'video/mp4', 'video/avi' | |
self.content = VIDEO | |
when 'image/gif', 'image/jpeg', 'image/png', "image/pjpeg", "image/x-png" | |
self.content = IMAGE | |
when 'audio/wav', 'audio/x-wav', 'audio/x-ms-wma', 'audio/mpeg', 'audio/x-m4a', 'audio/m4a' | |
self.content = AUDIO | |
when "application/msword", 'application/pdf', 'application/rtf', 'text/plain', 'text/rtf' | |
self.content = DOCUMENT | |
else | |
self.content = 0 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment