What is the easiest way to dump a selection of data for someone else
to import? If XML, what is the cleanest way to accomplish this?
As a hobby, I wrote a workout logging program that now has about 2000
users. From time to time, someone asks me to export their workout
records to another application. I finally decided to set up an XML
resource for this. But I don't want to put a lot of effort into it.
Right now, my controller looks like this:
@person = Person.find(params[:id])
@workouts = @person.workouts
My .builder template looks like this:
xml.instruct! :xml, :version=>"1.0"
for workout in @workouts
I also tried the builder template like this:
Both methods work, but the output is rather ugly, and I doubt others
will want to slog through it. Should I be using to_xml in combination
with the builder this way? Is there a better, cleaner, simpler way?