aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-04-04 19:28:25 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-04-04 19:28:25 +0000
commit62dc792a484e6e62fb2fb87fd47819144c5e3301 (patch)
tree4fb3e63b32292bd9d32fd62f72ee466884137922 /actionpack/lib/action_controller/base.rb
parent5821096a52843244a11814d2c6e7158451227933 (diff)
downloadrails-62dc792a484e6e62fb2fb87fd47819144c5e3301.tar.gz
rails-62dc792a484e6e62fb2fb87fd47819144c5e3301.tar.bz2
rails-62dc792a484e6e62fb2fb87fd47819144c5e3301.zip
CHANGED DEFAULT: Don't parse YAML input by default, but keep it available as an easy option [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-xactionpack/lib/action_controller/base.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 9d03a70588..751f364aa8 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -265,11 +265,9 @@ module ActionController #:nodoc:
# The param_parsers hash lets you register handlers wich will process the http body and add parameters to the
# @params hash. These handlers are invoked for post and put requests.
#
- # By default application/xml and application/x-yaml are enabled. For application/xml, a XmlSimple class with
- # the same param name as the root will be instanciated in the @params. This allows XML requests to mask themselves
- # as regular form submissions, so you can have one action serve both regular forms and web service requests. For
- # application/x-yaml, the YAML document is merged into the parameters and appears to the application as if the
- # YAML elements were simply form submissions.
+ # By default application/xml is enabled. A XmlSimple class with the same param name as the root will be instanciated
+ # in the @params. This allows XML requests to mask themselves as regular form submissions, so you can have one
+ # action serve both regular forms and web service requests.
#
# Example of doing your own parser for a custom content type:
#
@@ -283,9 +281,13 @@ module ActionController #:nodoc:
# in params[:r][:name] for "David" instead of params[:name]. To get the old behavior, you can
# re-register XmlSimple as application/xml handler ike this:
#
- # ActionController::Base.param_parsers[Mime::XML] =
+ # ActionController::Base.param_parsers[Mime::XML] =
# Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) }
- @@param_parsers = { Mime::XML => :xml_simple, Mime::YAML => :yaml }
+ #
+ # A YAML parser is also available and can be turned on with:
+ #
+ # ActionController::Base.param_parsers[Mime::YAML] = :yaml
+ @@param_parsers = { Mime::XML => :xml_simple }
cattr_accessor :param_parsers
# Template root determines the base from which template references will be made. So a call to render("test/template")