mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Short documentation to mention use of Mime::Type.register. Closes #5710 [choonkeat@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4665 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Short documentation to mention use of Mime::Type.register. #5710 [choonkeat@gmail.com]
|
||||
|
||||
* Make controller_path available as an instance method. #5724 [jmckible@gmail.com]
|
||||
|
||||
* Update query parser to support adjacent hashes. [Nicholas Seckar]
|
||||
|
||||
@@ -92,6 +92,12 @@ module ActionController #:nodoc:
|
||||
# Note that you can define your own XML parameter parser which would allow you to describe multiple entities
|
||||
# in a single request (i.e., by wrapping them all in a single root note), but if you just go with the flow
|
||||
# and accept Rails' defaults, life will be much easier.
|
||||
#
|
||||
# If you need to use a MIME type which isn't supported by default, you can register your own handlers in
|
||||
# environment.rb as follows.
|
||||
#
|
||||
# Mime::Type.register "image/jpg", :jpg
|
||||
#
|
||||
def respond_to(*types, &block)
|
||||
raise ArgumentError, "respond_to takes either types or a block, never both" unless types.any? ^ block
|
||||
block ||= lambda { |responder| types.each { |type| responder.send(type) } }
|
||||
@@ -167,4 +173,4 @@ module ActionController #:nodoc:
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user