THe part of code is:
def downloadCSV
require 'csv'
@ary = session[:ary]
csv_string= CSV.generate do |csv|
@ary.each do |t|
csv << [t]
end
end
send_data csv_string,
type: 'text/csv; charset=iso-8859-1; header=present',
disposition: 'attachment', filename: 'rannumgenerator.csv'
end
The web applet link is:
You can enter 1000 for N and 13 for C, click compute, get a result page,
which has
the code above is used for downloading CSV file after click CSV, which works
in rails 4.2.0, now instead of showing the download dialog, all numbers displayed
in the page.
Thanks!
Liz