aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/request.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-12-06 22:27:08 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-12-06 22:27:08 +0000
commit42596543dc0bac7aad9763b82ee4cc2b17f3110c (patch)
tree873c69b136730b34564b45bbd7c220e165272ddf /actionpack/lib/action_controller/request.rb
parent4c9000d51d0c39cfff438767f4709b8d8ad1c692 (diff)
downloadrails-42596543dc0bac7aad9763b82ee4cc2b17f3110c.tar.gz
rails-42596543dc0bac7aad9763b82ee4cc2b17f3110c.tar.bz2
rails-42596543dc0bac7aad9763b82ee4cc2b17f3110c.zip
respond_to recognizes JSON. render :json => @person.to_json automatically sets the content type and takes a :callback option to specify a client-side function to call using the rendered JSON as an argument. References #4185.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5694 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-xactionpack/lib/action_controller/request.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index 8c21adb8df..cff8522a02 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -66,6 +66,8 @@ module ActionController
content_type = 'application/x-yaml'
when 'xml'
content_type = 'application/xml'
+ when 'json'
+ content_type = 'application/x-json'
end
end