I didn't find any examples of how it is possible (if it is) to send a generated Excel file based on some ActiveRecord collection.
For a PDF file generated with Prawn, I could do that as follows:
# in a controller
@operation = @account.operations.find(params[:id])
report = OperationReport.new
output = report.to_pdf(@operation)
respond_to do |format|
send_data output, type: :pdf, disposition: "inline"
Any ideas for Excel ? Thank you.