Added Mime::TEXT (text/plain) and Mime::ICS (text/calendar) as new default types [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2006-06-02 04:16:03 +00:00
parent 984aa7eeb9
commit 5240d7a84b
2 changed files with 7 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
*SVN*
* Added Mime::TEXT (text/plain) and Mime::ICS (text/calendar) as new default types [DHH]
* Added Mime::Type.register(string, symbol, synonyms = []) for adding new custom mime types [DHH]. Example: Mime::Type.register("image/gif", :gif)
* Added support for Mime objects in render :content_type option [DHH]. Example: render :text => some_atom, :content_type => Mime::ATOM

View File

@@ -117,6 +117,7 @@ module Mime
end
ALL = Type.new "*/*", :all
TEXT = Type.new "text/plain", :text
HTML = Type.new "text/html", :html, %w( application/xhtml+xml )
JS = Type.new "text/javascript", :js, %w( application/javascript application/x-javascript )
ICS = Type.new "text/calendar", :ics
@@ -130,6 +131,8 @@ module Mime
LOOKUP["*/*"] = ALL
LOOKUP["text/plain"] = TEXT
LOOKUP["text/html"] = HTML
LOOKUP["application/xhtml+xml"] = HTML
@@ -155,6 +158,8 @@ module Mime
EXTENSION_LOOKUP["html"] = HTML
EXTENSION_LOOKUP["xhtml"] = HTML
EXTENSION_LOOKUP["txt"] = TEXT
EXTENSION_LOOKUP["xml"] = XML
EXTENSION_LOOKUP["js"] = JS