I'm trying to generate a simple XML feed using Rails' to_xml:
xml = {
:id => '1234',
:title => 'Title',
:url => 'www.site.com',
:items => items.to_xml(:skip_instruct => true, :skip_types => true, :include => :user)
}.to_xml(:root => 'feed', :skip_types => true)
I have two problems with this approach:
- Everything inside
<items>is ecscaped and renders as regular text. - It generates an additional
<items>node
So the resulting <items> node looks like
<items>
<items> ... </items>
<items>
How can I make it work using just to_xml?