我正在尝试将报告导出为CSV格式的文档。为此,我使用了fasterCSV,但我面对
Please switch to Ruby 1.9's standard CSV library.
It's FasterCSV plus support for Ruby 1.9's m17n encoding engine.错误。有人能帮我解决这个错误吗?我的代码如下
csv_string = FasterCSV.generate do |csv|
csv << ["Client_name", "Created_at", "User type"]
@client_reports.each do |client_reports|
csv << [client_reports.email, client_reports.created_at,client_reports.role_name]
end
end
send_data csv_string,
:type => 'text/csv; charset=iso-8859-1; header=present',
:disposition => "attachment; filename=product_stock.csv"所以请帮助我在Ruby 1.9.3中解决这个问题。它在Ruby 1.8.7中工作得很好。
或者,如果你能给我推荐其他资源,请帮我举个例子?
https://stackoverflow.com/questions/11507851
复制相似问题