Topic: to_csv - which plugin is best?

Hi,

I'm looking for a way to generate csv data including data from associated objects. I've found this to_csv plugin, but it seems it doesn't handle associations.

Other option is to use Ruport and its acts_as_reportable functionality, as it seems that its report_table function handles very similar options as Rails built-in to_xml method. However, it's not as easy to use as to_xml method:

Book.report_table(:all, :include => [:author]).as(:csv)

but I guess it would be easy to write to_csv method (or actualy to_anything_supported_by_ruport, so one can get text, pdf, csv or html) and just pass its parameters to report_table method.

Do you think it's a good idea to create a small to_anything_supported_by_ruport wrapper over Ruport's report_table method, or is there already a to_csv plugin that supports associations and doesn't need additional library (Ruport)?

[EDIT] I'm not sure if writing report_table wrapper is going to be so easy, beacause I need to call to_whatever on Array object (of ActiveRecord objects) and report_table acts rather as find method of ActiveRecord class.

Last edited by g0nzo (2007-07-15 15:55:52)