refactored

This commit is contained in:
dinsmol 2021-08-12 12:02:34 +03:00
parent 8f17712232
commit d2d31c049c
19 changed files with 32 additions and 112 deletions

View file

@ -28,17 +28,7 @@ module Admin
@versions = @q.result.page(params[:page])
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
respond_to do |format|
format.html do
render 'admin/contact_versions/index'
end
format.csv do
raw_csv = @q.result.to_csv
send_data raw_csv,
filename: "contact_history_#{Time.zone.now.to_formatted_s(:number)}.csv",
type: "#{Mime[:csv]}; charset=utf-8"
end
end
render_by_format('admin/contact_versions/index', 'contact_history')
end
def show