Topic: Jquery update through XML


We are building a web app that needs to be able to update records through jquery in an XML format to our controller.
We already have this working, but when updating we always get something like this in our database

--- !map:ActiveSupport::HashWithIndifferentAccess 
div: !map:ActiveSupport::HashWithIndifferentAccess 
  class: tables
  div: !map:ActiveSupport::HashWithIndifferentAccess 
    style: "position: relative;"
    class: table
    div: !map:ActiveSupport::HashWithIndifferentAccess 
      class: tablePart simple
      div: !map:ActiveSupport::HashWithIndifferentAccess 
        class: block
        network_infrastructure_id: "1"
        network_infrastructure_name: VISI-201-NW

This is the HTML we are sending through xml.

  <div class="tables"><div style="position: relative;" class="table"><div class="tablePart simple"><div class="block" network_infrastructure_id="1" network_infrastructure_name="VISI-201-NW"></div></div></div></div>

This is the jquery code we are using

      type: "PUT",
      url: "/network_internet_control_layouts/"+room_id+".xml",
      data: '<network-internet-control-layout><layout>'+$("div#temp").html()+'</layout></network-internet-control-layout>',
      contentType: 'application/xml', // format of request payload
      dataType: 'xml', // format of the response
      success: function(msg) {
        alert( "Data Saved: " + msg );

Do I need to escape something or what could be the problem?

Last edited by reyntjensw (2011-03-29 03:21:16)