FasterCSV isn't rendering columns

Hi,

I have a problme with fasterCSV, it isn't rendering columns... I don't understand why. All my columns are inside the first column the csv file :frowning:

csv_string = FasterCSV.generate(:col_sep => "\t") do |csv|       # header row       csv << ["id", "Email", "Ville", "Type", "Fréquence"]       # data rows       alerts.each do |alert|         csv << [alert.id, alert.email, alert.city, alert.frequence]       end     end

Rendering: data = Alert.export_to_csv         send_data data,           :type => 'text/csv; charset=utf-8; header=present',           :disposition => "attachment; filename=alerts_#{params[:export_kind]}.csv"

Greg

Hi,

I have a problme with fasterCSV, it isn't rendering columns... I don't understand why. All my columns are inside the first column the csv file :frowning:

csv_string = FasterCSV.generate(:col_sep => "\t") do |csv| # header row csv << ["id", "Email", "Ville", "Type", "Fréquence"] # data rows alerts.each do |alert| csv << [alert.id, alert.email, alert.city, alert.frequence] end end

Have you used ruby-debug or similar method to break into here to see whether csv_string is setup correctly?

Colin

Colin Law wrote in post #964287:

So you have no problem with FasterCSV then. What exactly _is_ the problem?

Colin

Colin Law wrote in post #964301:

You showed some code earlier for rendering but I did not see where it is using csv_string. Can you clarify what you are doing with the string?

Colin