Report generation. Download csv

This commit is contained in:
German Galia
2019-06-12 10:17:31 +02:00
parent 139b2720d8
commit 9d1ca3bfd4
63 changed files with 1528 additions and 40 deletions

View File

@@ -0,0 +1,17 @@
class Admin::CommentsController < Admin::BaseController
include DownloadSettingsHelper
def index
@comments = Comment.sort_by_newest.page(params[:page])
respond_to do |format|
format.html
format.csv {send_data to_csv(Comment.sort_by_newest, Comment),
type: "text/csv",
disposition: "attachment",
filename: "comments.csv" }
end
end
end