aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/mime_responds.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2006-08-05 02:00:04 +0000
committerMichael Koziarski <michael@koziarski.com>2006-08-05 02:00:04 +0000
commit6c5059748903971ce105c419ec775a58ae97c54c (patch)
treee7893e590d6a27f77f90d24ea50a2b960ae27df4 /actionpack/lib/action_controller/mime_responds.rb
parent12ab93b72b4f98fb2e6ce9102ff9fb2cdb6c992b (diff)
downloadrails-6c5059748903971ce105c419ec775a58ae97c54c.tar.gz
rails-6c5059748903971ce105c419ec775a58ae97c54c.tar.bz2
rails-6c5059748903971ce105c419ec775a58ae97c54c.zip
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
Diffstat (limited to 'actionpack/lib/action_controller/mime_responds.rb')
-rw-r--r--actionpack/lib/action_controller/mime_responds.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/mime_responds.rb b/actionpack/lib/action_controller/mime_responds.rb
index 65d341f6f4..4ff00bf8a5 100644
--- a/actionpack/lib/action_controller/mime_responds.rb
+++ b/actionpack/lib/action_controller/mime_responds.rb
@@ -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 \ No newline at end of file
+end