From: Brian Candler Date: 2009-01-27T23:57:48+09:00 Subject: Re: xml Harish Dewangan wrote: > when i add the Code what you gave like STDERR.puts foo.inspect > it printed like this, i think this is correct data. > # child2: ["Second"], child3: ["Third"], id: nil> No, that's wrong, and it explains why your data is getting serialized as YAML. Each of your attributes is an array: ["1"] when it should be just a string "1" XmlSimple is giving you an array because you might get multiple elements with the same name: foo bar baz ... So your code which copies from your XML structure into your ActiveRecord model needs changing, e.g. by using .first or [0] to pick the first array element. I have a vague recollection that there's an option you can pass to XmlSimple for it *not* to put elements inside arrays; look through the docs. -- Posted via http://www.ruby-forum.com/.