Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

array.to_xml should be able to handle all types of data elements

#4490

As of now array.to_xml only works if each of the elements of array respond_to to_xml. It means an array like the one given below consisting of only integer will not work.

a = [1, 2 ,3]
a.to_xml #=> will blow up

Attached is a patch that fixes this problem and brings to_xml support of an array inline with to_xml support of a hash.

Reported by Neeraj Singh · April 27th, 2010 @ 09:44 PM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: none