Mason K. wrote:
I found how i could generate an .xml file on the fly
with .rxml, much like i can generate an .html file with
While this will create the file I need, it only exists
momentarily and then dissapears leaving me with
only a .rxml once the RoR actions are done. What
I would like to do is have the .xml export to a separate
location so that it can be used by another application.
One option, if you’re sure you just want to save what you’re already
rendering, might be to render_to_string and then save that to a .xml
Might be worth a shot, but I wouldn’t be surprised if it didn’t work for
reason or another.
The RoR is there to act as an CRUD for the XML info.
I want my client to be able to add/edit/delete items from
its XML file.
To make sure I read this right… you don’t mean you want to edit the
file natively do you? If so, I think that would be pretty far outside
sweet-spot for RoR.
If I understand what you mean by "RoR is there to act as… ", then
probably thinking along the lines of what I’m doing. My RoR app
data from the visitor into MySQL (in my case). When they want to save
data they’ve entered, I use Builder to create an XML file from the data
stored in MySQL. If they want to update an existing file, I use REXML to
bring the data stored in the XML file (back) into MySQL, etc… That is
pretty much dead center of the RoR sweet spot wrt XML, IMO.
Is it possible to set up the .xml file to save in a specified
directory once the .rxml pieces it together into a .xml?
Independent of how you get there, you’re going to end up just doing a
routine file save. Nothing magic there.