# coding: utf-8
def generate_csv(csv_file_name)
data = CSV.generate do |csv|
csv << [['Тест','Тест1'].join(';')]
csv << [['1','2'].join(';')]
end
send_data data,
type => 'text/csv; charset=windows-1251; header=present',
disposition => "attachment; filename=#{csv_file_name}"
end