On 27 November 2010 14:10, Greg Ma <li...@ruby-forum.com> wrote: > 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 > :( > > 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 > > > 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 > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.