nesquena/rabl — pull request #262 by gvieira (2012-06-05 13:32:51+00:00)
Title: Add support for CSV format to RABL

I know CSV is not a proper tree structure as JSON, XML and PList, anyway I needed to export data to CSV in a project that was already using RABL and I thought it would be great to use the same engine.

It uses the ruby's built-in CSV engine but it can also use FasterCSV and any other engine that provides a generate method.

I have also added a csv_options that accepts a hash and passes it to generate method, so people can set their own column and row separators, as much as other many options (see http://www.ruby-doc.org/stdlib-1.9.3/libdoc/csv/rdoc/CSV.html#method-c-new).

(Based on https://github.com/nesquena/rabl/pull/153)