Closed
Description
I have created a base repo:
https://github.com/NickBeukema/axlsx_rails_testing
For both regular and api only mode, for both have done the following
- Generate App and
Lead
model with propertiesName
andOccupation
- Create
LeadsController
withindex
method, addresources :leads
to routes file - Create
views/leads/index.xlsx.axlsx
file for rendering the.xlsx
file
I visit the url and the api only version exports the file as 1 byte and cannot be opened, while the non api only version exports the excel file normally.
To reproduce the two repos, do the following:
- Clone and bundle
rails db:migrate db:seed
rails s
- Visit
localhost:3000/leads.xlsx
I've also added a json
responder to assure that the data is there and the respond_to
function is working, so you can visit localhost:3000/leads.json
to see the json data.
Do you know what dependencies I'm missing in the api only version? I've already included ActionController::MimeResponds
to allow for respond_to
usage. Any help would be great!
Metadata
Metadata
Assignees
Labels
No labels