Fix contact history csv

This commit is contained in:
dinsmol 2022-01-25 01:08:01 +03:00 committed by olegphenomenon
parent a9b942dac0
commit 578b75da20
3 changed files with 50 additions and 11 deletions

View file

@ -4,6 +4,9 @@ module Admin
load_and_authorize_resource class: Version::DomainVersion
MODEL = Domain
CSV_HEADER = ['Name', 'Registrant', 'Registrar', 'Action', 'Created at'].freeze
def index
params[:q] ||= {}
@ -93,7 +96,7 @@ module Admin
respond_to do |format|
format.html { render page }
format.csv do
raw_csv = csv_generate
raw_csv = csv_generate(MODEL, CSV_HEADER)
send_data raw_csv,
filename: "#{filename}_#{Time.zone.now.to_formatted_s(:number)}.csv",
type: "#{Mime[:csv]}; charset=utf-8"