This is probably very simple: I’m creating a workbook (i.e. spreadsheet) using the Spreadsheet gem, and just want to send the Excel data directly to the client without having to write to a file first.
Right now, I’m writing the workbook to a file in the tmp dir, and then sending it using send_file, but that seems terribly inelegant as I don’t need the file once it’s been sent (not even for caching purposes).
Optimally, I’d like to just call send_data with the workbook data in a respond_to :xls block.
Any ideas?
The workbook’s
writemethod takes any path or IO object, so instead of passing it a file or file path you could pass it a StringIO., something along the lines of