Brian Candler wrote: > Harish Dewangan wrote: >> i am new ruby on rails > > ... > >> i got pure xml now and converting that xml into model object and when i >> am trying to save the object it is inserting with the junk values as >> shown below > > Problems with Rails and/or ActiveRecord would best be asked on a Rails > mailing list (here you have found the general Ruby programming language > list) > > From a Ruby point of view, I'd suggest you try using 'inspect' on your > model before saving it. e.g. > > # create your model > foo = Foo.new(...) > > # show it > STDERR.puts foo.inspect > > foo.save! > > This divides your problem in half: if @attributes contains the right > data then the problem is when ActiveRecord saves it, but if @attributes > contains the bad data then you can work on the first part of your > program. > >> '---- "1"', '--- - "2"', '--- - "3"', '--- - First', '--- - Second', >> '--- - third' > > Strange, looks like it's converting to YAML for some reason. Sir, when i add the Code what you gave like STDERR.puts foo.inspect it printed like this, i think this is correct data. #<XMLDemo first: ["1"], second: ["2"], third: ["3"], child1: ["First"], child2: ["Second"], child3: ["Third"], id: nil> But still i am facing the same problem. plz help to solve this prb Thanks in Advance Harish Kumar Dewangan -- Posted via http://www.ruby-forum.com/.