Calling to_xml on an Array of ROXML objects results in an empty collection

Posted by findchris on Stack Overflow See other posts from Stack Overflow or by findchris
Published on 2010-05-21T23:16:44Z Indexed on 2010/05/21 23:20 UTC
Read the original article Hit count: 149

Filed under:
|
|

Hi there.

I have a ROXML object that looks like:

class Activity
  include ROXML
  xml_accessor :id
end

If I have an array of these objects and call .to_xml on the array, I receive an empty xml collection:

"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<activities type=\"array\">\n</activities>\n"

Any idea why or how to fix this?

I'm running Rails 2.3.5 with the newest version of ROXML.

Thanks

© Stack Overflow or respective owner

Related posts about ruby

Related posts about rails