Class: Dradis::Plugins::CSVExport::ReportsController

Inherits:
Export::BaseController
  • Object
show all
Defined in:
app/controllers/dradis/plugins/csv_export/reports_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


7
8
9
10
11
12
13
14
15
# File 'app/controllers/dradis/plugins/csv_export/reports_controller.rb', line 7

def create
  exporter = Dradis::Plugins::CSVExport::Exporter.new(export_params)
  csv = exporter.export

  send_data csv,
    disposition: 'inline',
    filename: "dradis_report-#{Time.now.to_i}.csv",
    type: 'text/csv'
end