Class: ODDB::Html::View::Drugs::DownloadExport

Inherits:
HtmlGrid::Component
  • Object
show all
Defined in:
lib/oddb/html/view/drugs/download_export.rb

Instance Method Summary collapse

Instance Method Details

#http_headersObject



12
13
14
15
16
17
18
19
# File 'lib/oddb/html/view/drugs/download_export.rb', line 12

def http_headers
  {
    "Content-Type"        => "text/csv",
    "Cache-Control"       => "no-cache, max-age=3600, must-revalidate",
    "Content-Disposition" => "attachment; filename=#{@model.filename}",
    "Refresh"             => "0; URL=#{@lookandfeel._event_url(:home)}",
  }
end

#to_html(context) ⇒ Object



20
21
22
23
# File 'lib/oddb/html/view/drugs/download_export.rb', line 20

def to_html(context)
  Export::Csv::Packages.new.export @model, @lookandfeel.csv_components,
                                   @session.language
end