In my result.csv.erb, I have a issue with the csv being createdas within some of the columns in the result, I get data spillage.
I have a column called title which can be be of the form Son's of fortune
, or Love,Fear,Hatred
. In the first case, for some reason, I get " in my result. In the other, the data gets split by , as default :col_sep is ,.
<%- @results.each do |result| -%>
<%- row = result.values -%>
<%= CSV.generate_line row, :row_sep => nil, :quote_char => "'" %>
<%end%>
For eg-: The title was Gas Shoe (Grey, Chestnut)
and the result spills into the other columns
title - "Gas Shoe (Grey
seller - Chestnut)"
I am open to editing the data before insertion if absolutely necessary. So any ideas?