def export
headers['Content-Type'] = 'application/vnd.ms-excel; charset=windows-1251'
headers['Content-Disposition'] = 'attachment; filename="report_payments.xls"'
headers['Cache-Control'] = ''
respond_to do |format|
format.html
format.xls
end
end
<table>....</table>