Hi,
I have a problem..
I am Working on Rails with Flex.
I am getting a xml from the flex form.. I need to get the xml and
has to insert the record
The xml I am getting in the form as...
<root>
<insert>
<number>
100
</number>
<name>
"xyz"
</name>
<address>
<street>
<street1> 12-32-122/34 </street1>
<street2> 123 road </street2>
</street>
<city> unknown </city>
<state> state </state>
<country> In </country>
<zip> 321456 </zip>
</address>
<job>
Developer
</job>
.
.
</insert>
<insert>
<number>
101
</number>
<name>
"pqr"
</name>
<address>
<street>
<street1> 1-122/76 </street1>
<street2> cross road </street2>
</street>
<city> city </city>
<state> some state </state>
<country> US </country>
<zip> 321456 </zip>
</address>
<job>
Developer
</job>
.
.
</insert>
.
.
.
</root>
In these... each insert tag is a record which have to be entered into
DB.
But we are receiving the xml as HashWithIndifferentAccess
params[:xml].class => HashWithIndifferentAccess
We tried converting into hash
h = (params[:xml]).Hash
puts "#{h.to_xml}"
it is showing the error as "Not all elements respond to to_xml"
How to achieve the insertion are there any ways to get the xml...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---