diff options
author | Jamis Buck <jamis@37signals.com> | 2006-03-15 15:12:24 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2006-03-15 15:12:24 +0000 |
commit | 6784749f3bd9bc4939a4d6b2e0dd831a3125f0dd (patch) | |
tree | 87f9c9b742aec760ec12e1165f936f0bc6ce39d7 | |
parent | fa4fb50186cb80e824ce1a6a91bde2c2870628de (diff) | |
download | rails-6784749f3bd9bc4939a4d6b2e0dd831a3125f0dd.tar.gz rails-6784749f3bd9bc4939a4d6b2e0dd831a3125f0dd.tar.bz2 rails-6784749f3bd9bc4939a4d6b2e0dd831a3125f0dd.zip |
Fix Mime::Type#to_sym to do @string.to_sym. Add text/yaml as alias for Mime::YAML
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3873 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_controller/mime_type.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/mime_type.rb b/actionpack/lib/action_controller/mime_type.rb index ba46f98ace..35095dc770 100644 --- a/actionpack/lib/action_controller/mime_type.rb +++ b/actionpack/lib/action_controller/mime_type.rb @@ -42,7 +42,7 @@ module Mime end def to_sym - @symbol || to_sym + @symbol || @string.to_sym end def ===(list) @@ -64,7 +64,7 @@ module Mime XML = Type.new "application/xml", :xml, %w( text/xml application/x-xml ) RSS = Type.new "application/rss+xml", :rss ATOM = Type.new "application/atom+xml", :atom - YAML = Type.new "application/x-yaml", :yaml + YAML = Type.new "application/x-yaml", :yaml, %w( text/yaml ) LOOKUP = Hash.new { |h, k| h[k] = Type.new(k) } @@ -81,7 +81,9 @@ module Mime LOOKUP["application/javascript"] = JS LOOKUP["application/x-javascript"] = JS + LOOKUP["text/yaml"] = YAML + LOOKUP["application/x-yaml"] = YAML + LOOKUP["application/rss+xml"] = RSS LOOKUP["application/atom+xml"] = ATOM - LOOKUP["application/x-yaml"] = YAML end
\ No newline at end of file |