About mime/types

This is a discussion on About mime/types within the RUBY forums in Programming Languages category; Why does this MIME::Types['text/plain'] give 'text/plaintext/plain'? The thing is I'm trying to understand how to use mime/types http://mime-types.rubyforge.org/classes/MIME/Types.html and I can't mimic this example: plaintext = MIME::Types['text/plain'] print plaintext.media_type # => 'text' print plaintext.sub_type # => 'plain' It doesn't work unless I do MIME::Types['text/plain'].first. Why? -- Posted via http://www.ruby-forum.com/ ....

Go Back   Application Development Forum > Programming Languages > RUBY

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-28-2008, 03:03 AM
Pål Bergström
Guest
 
Default About mime/types

Why does this MIME::Types['text/plain'] give 'text/plaintext/plain'?

The thing is I'm trying to understand how to use mime/types
http://mime-types.rubyforge.org/classes/MIME/Types.html and I can't
mimic this example:


plaintext = MIME::Types['text/plain']
print plaintext.media_type # => 'text'
print plaintext.sub_type # => 'plain'

It doesn't work unless I do MIME::Types['text/plain'].first. Why?
--
Posted via http://www.ruby-forum.com/.

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:39 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.