Having a controller template doing
render 'statistics/shared/workbook`
and the _workbook partial being something like:
book = xlsx_package.add_worksheet
sheet = book.add_worksheet(name: "something")
sheet.add_row ['row', 'boat', 'show']
Makes the generated xlsx file corrupt. Moving the partial contents to the template directly and the file is not corrupt and work as it should.