Both of these methods are in the controller. The method is called with /<controller plural>.xml;directory. The route completes, I get
XML Parsing Error: no element found Location: <controller plural>.xml;mytest Line Number 1, Column 1:
def mytest
respond_to do |format| format.html # index.rhtml format.xml { render :xml => try_xml_builder } end end
def try_xml_builder
xml = Builder::XmlMarkup.new(:indent=>2) xml.instruct! xml.person { |b| b.name("Jim"); b.phone("555-1234") } return xml end
If I override to_xml with the same builder script in the mode, everything is great. There's something wrong with the xml return value and render :xml, but I'm not sure what it is. The example for builder is from the builder pages, and returns the correct xml.
I'm running rails 1.2.2.