I am trying to output a CSV file in ruby, that looks like this:
"numeric_column","string_column"
1,"string1"
2,"long string"
I could only find a way to have no quotes at all or quotes also on the numeric column.
My code looks like this now:
CSV.open("file.csv", "wb", force_quotes: true, headers: ['id', 'name'], write_headers: true) do |csv|
csv << [id, name]
end