title: send_data for csv file returns text of file, not file
body: <p>Good day! I want to download autogenerated file qwerty.csv, but it returns only text "12345" (without file). Can you help me?</p>
  
  <p><strong>UI</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function getCsv() {
      var ids = getSelectedRecordIds();
      $.post('/payments/form_csv.csv', { ids: ids }, function(data) {});
  }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>def form_csv
      csv_string = CSV.generate do |csv|
          csv &lt;&lt; ["12345"]
      end
  
      respond_to do |format|
          format.csv {
              send_data csv_string, :type =&gt; 'text/csv; charset=utf-8; header=present', :disposition =&gt; "attachment; filename=qwerty.csv", :filename =&gt; "qwerty.csv"
          }
      end
  end
  </code></pre>
  
  <p><strong>In console</strong></p>
  
  <pre><code>Started POST "/payments/form_csv.csv" for 127.0.0.1 at 2012-06-18 18:18:11 +0400 
  Processing by PaymentsController#form_csv as CSV
    Parameters: {"ids"=&gt;["18\n\t  "]}
    Rendered text template (0.0ms)
  Sent data qwerty.csv (0.4ms)
  Completed 200 OK in 2ms (Views: 0.4ms | ActiveRecord: 0.0ms)
  </code></pre>
  
  <p>But there are no file prompt...</p>