title: Ruby on Rails create CSV with separate lines
body: <p>I am trying to create a csv file for the user to download.  I am able to create the file ok, but am having problems adding a new line for each separate entry.  I read some old responses that recommended adding csv &lt;&lt; "\n", but that does not seem to work properly.  Excel is able to open the CSV file correctly, but I need to be able to view it in notepad.  In notepad, it is just one long string of words. </p>
  
  <p>The code that I am using is:</p>
  
  <pre><code>csv_file = CSV.generate(headers: true) do |csv|
    csv &lt;&lt; attributes
    @volunteers.each do |v|
      csv &lt;&lt; [v.id, v.last_name, v.first_name]
    end
  end
  
  send_data csv_file, filename: "volunteers.csv" 
  </code></pre>