mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user