Topic: Generate XML document

Hi,

I was wondering if there was a quick and easy way to generate an XML document and save it to the server.

Thanks

Re: Generate XML document

If you want to create XML data from a model or collection of models, you can use the to_xml method. If you want to have control over the XML data, you can use an XML Builder. As for saving to a file, you can do something like:

File.open('xml_data', 'w+') { |f| f.puts xml_data }

Railscasts - Free Ruby on Rails Screencasts

Re: Generate XML document

Thanks worked a treat.