Top Level Namespace

Defined Under Namespace

Modules: ExcelBuilder

Instance Method Summary collapse

Instance Method Details

#send_workbook(workbook) ⇒ Object



18
19
20
21
22
23
24
25
# File 'ext/app.rb', line 18

def send_workbook(workbook)
  os = java.io.ByteArrayOutputStream.new
  workbook.instance_variable_get('@workbook').write(os)
  headers['Content-Type'] = "application/vnd.ms-excel"
  headers['Content-Disposition'] = 'attachment; filename="' + params[:filename] + '.xlsx"'
  headers['Cache-Control'] = ''
  String.from_java_bytes(os.toByteArray)
end