From 86d2b2792a50d21462216b18fb63e57a628ca40f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 14 May 2005 08:38:37 +0000 Subject: Added support for POST data in form of YAML or XML, which is controller through the POST_DATA_MARSHAL header git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 30 ++++++++++++++++++++++++++++++ actionpack/lib/action_view/base.rb | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 50e135be72..94bbe0d534 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,35 @@ *SVN* +* Added support for POST data in form of YAML or XML, which is controller through the POST_DATA_MARSHAL header. Example request: + + POST_DATA_MARSHAL: xml + HelloWorld + + ...is the same as: + + POST_DATA_MARSHAL: yaml + --- + item: + content: HelloWorld + + ...is the same as: + + item[content]=HelloWorld + + Which in the end turns into { "item" => { "content" => "HelloWorld" } }. This makes it a lot easier to publish REST web services on top of your regular actions (as they won't care). + + Example Curl call: + + curl -H 'POST_DATA_MARSHAL: xml' -d 'KillMeMore' http://www.example.com/service + + You can query to find out whether a given request came through as one of these types with: + - request.post_format? (:query_string, :xml or :yaml) + - request.formatted_post? (for either xml or yaml) + - request.xml_post? + - request.yaml_post? + +* Added bundling of XmlSimple by Maik Schmidt + * Fixed that render_partial_collection should always return a string (and not sometimes an array, despite <%= %> not caring) * Added TextHelper#sanitize that can will remove any Javascript handlers, blocks, and forms from an input of HTML. This allows for use of HTML on public sites, but still be free of XSS issues. #1277 [Jamis Buck] diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 72200904f0..b0737f0f0b 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -218,7 +218,7 @@ module ActionView #:nodoc: if @@template_handlers[template_extension] "delegate_render" else - (template_extension == "rxml" ? "rxml" : "rhtml") + "_render" + (template_extension.to_s == "rxml" ? "rxml" : "rhtml") + "_render" end end -- cgit v1.2.3