In my InvoicesController I have this:
InvoicesController
def index @invoices = current_user.invoices respond_to do |format| format.html format.xls form
Try this
format.csv do response.headers["Content-Type"] = "text/csv; charset=UTF-8; header=present" response.headers["Content-Disposition"] = "attachment; filename=invoices.csv" end