From f60d7c588241a4ec33d61a9be8dfbd55e6a52746 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Sun, 20 Jun 2010 18:36:43 +0200 Subject: [PATCH] added possibility to send plists as post parameters --- init.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 575a517..f4e6508 100644 --- a/init.rb +++ b/init.rb @@ -1,4 +1,10 @@ require 'plistifier/plist_encoding' require 'rails_extensions' -Mime::Type.register "application/plist", :plist \ No newline at end of file +Mime::Type.register "application/plist", :plist + +ActionController::Base.param_parsers[Mime::Type.lookup("application/plist")] = lambda do |body| + str = StringIO.new(body) + plist = CFPropertyList::List.new({:data => str.string}) + CFPropertyList.native_types(plist.value) +end \ No newline at end of file