I want to separate this into the variables name, date, month, year,
and administrator but I do not know how to do this in Rails. Is there
an easy way?
That's odd, as that's just the same data that a form would submit. Is
GWT submitting it with a funny mime type?
You can configure parameter parsers on a per MIME type basis via the
ActionController::Base.param_parsers hash
OK so I changed the Content-Type to "application/x-www-form-
urlencoded"
and in Mongrel the parameters passed look like this:
Parameters: {"name"=>"hello date=12 month=07 year=2008
administrator=brewer", "action"=>"createEvent",
"controller"=>"calendar"}
i.e. Rails has only identified the first parameter and has assigned
everything else to it. Whats going on?
Incidentally if I set the Content-Type to either text/plain, text/xml
or application/xml Rails gives me a:
Status: 500 Internal Server Error
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.attributes
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
vendor/xml-simple-1.0.11/xmlsimple.rb:708:in `get_attributes'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
vendor/xml-simple-1.0.11/xmlsimple.rb:462:in `collapse'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
core_ext/hash/conversions.rb:13:in `xml_in_string'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
core_ext/hash/conversions.rb:23:in `xml_in_string'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
core_ext/hash/conversions.rb:171:in `from_xml'
OK so I changed the Content-Type to "application/x-www-form-
urlencoded"
and in Mongrel the parameters passed look like this:
Parameters: {"name"=>"hello date=12 month=07 year=2008
administrator=brewer", "action"=>"createEvent",
"controller"=>"calendar"}
That's odd. Have you checked (eg with tcpdump or similar or sticking a
breakpoint in the rails parameter thingy before it has parsed the
parameters) exactly what bytes your mongrel is receiving ?