I am using the Tmail library, and for each attachment in an email, when I do attachment.content_type, sometimes I get not just the content type
attachment.content_type
# will be true if the content type is included VALID_CONTENT_TYPES.include? attachment.content_type.gsub!(/^(image\/[a-z]+).+$/, "\1")