i have a doubt with acts_as_api. i want to format a xml string like this:
<root> <child property="property_value">Some Text</child> etc </root>
this is possible?
thank's in advance
I think this will not work automagically as you want to put data in your XML structure in two different places:
But the attributes of your model are contained a single Hash. acts_as_api (or another serializer) can't determine which attributes are supposed to be in a property and which one should be taken as the inner text.
acts_as_api
For this case you will have to provide your own serializer (you can have a look at http://api.rubyonrails.org/classes/ActiveRecord/Serialization.html#method-i-to_xml on how to do it in Rails.
1.4m articles
1.4m replys
5 comments
57.0k users