Follow Along as I Stumble on the Path to Learning RoR

CSV Export

One gem to use to allow users to export table data, like reports, is FasterCSV.  The only thing is that there isn’t a lot of documentation on it.  Here is a great tutorial on it:

http://rubyglasses.blogspot.com/2009/07/csv-views-with-fastercsv-and-csvbuilder.html

The only minor issue I ran into was that I needed to add this line:
@output_encoding = ‘UTF-8’

under the format.csv part, like so:

format.csv do
@output_encoding = ‘UTF-8’
end

Advertisements

Comments are closed.