Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4024

Show
Ignore:
Timestamp:
03/25/06 18:44:28 (3 years ago)
Author:
minam
Message:

Enable application/x-yaml processing by default

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r4014 r4024  
    11*SVN* 
     2 
     3* Enable application/x-yaml processing by default [Jamis Buck] 
    24 
    35* Fix double url escaping of remote_function. Add :escape => false option to ActionView's url_for. [Nicholas Seckar] 
  • trunk/actionpack/lib/action_controller/base.rb

    r3991 r4024  
    266266    # @params hash. These handlers are invoked for post and put requests. 
    267267    # 
    268     # By default application/xml is enabled. A XmlSimple class with the same param name as the root  
    269     # will be instanciated in the @params. This allows XML requests to mask themselves as regular form submissions, 
    270     # so you can have one action serve both regular forms and web service requests. 
     268    # By default application/xml and application/x-yaml are enabled. For application/xml, a XmlSimple class with 
     269    # the same param name as the root will be instanciated in the @params. This allows XML requests to mask themselves 
     270    # as regular form submissions, so you can have one action serve both regular forms and web service requests. For 
     271    # application/x-yaml, the YAML document is merged into the parameters and appears to the application as if the 
     272    # YAML elements were simply form submissions. 
    271273    #  
    272274    # Example of doing your own parser for a custom content type: 
     
    280282    # root node for such requests. The new default is to keep the root, such that "<r><name>David</name></r>" results 
    281283    # in params[:r][:name] for "David" instead of params[:name]. To get the old behavior, you can  
    282     # re-register XmlSimple as application/xml handler and enable application/x-yaml like this: 
     284    # re-register XmlSimple as application/xml handler ike this: 
    283285    # 
    284286    #   ActionController::Base.param_parsers[Mime::XML]  =  
    285287    #     Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) } 
    286     #   ActionController::Base.param_parsers[Mime::YAML] = :yaml 
    287     @@param_parsers = { Mime::XML => :xml_simple } 
     288    @@param_parsers = { Mime::XML => :xml_simple, Mime::YAML => :yaml } 
    288289    cattr_accessor :param_parsers  
    289290