Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6 API only [object Object] #138

Closed
eduscrakozabrus opened this issue Feb 6, 2020 · 3 comments
Closed

Rails 6 API only [object Object] #138

eduscrakozabrus opened this issue Feb 6, 2020 · 3 comments

Comments

@eduscrakozabrus
Copy link

my routs:
get 'conversations/export-excel', to: 'conversations#export_excel', defaults: { format: "xlsx" }

my controller:
def export_excel @сonversations = Conversation.all respond_to do |format| format.xlsx end end
my example axlsx:
`p = Axlsx::Package.new
wb = p.workbook

wb.add_worksheet(:name => "Basic Worksheet") do |sheet|
sheet.add_row ["First Column", "Second", "Third"]
sheet.add_row [1, 2, 3]
sheet.add_row [' preserving whitespace']
end`

but have in file one value: [object Object]

@straydogstudio
Copy link
Collaborator

Rails in api mode does not include the template loading mechanism. It does not include ActionView. This is probably your issue. See this issue for suggestions: #107

@joelGarcia93
Copy link

@eduscrakozabrus how did you fix this? can you share important files to solve this issue? I'm trying but I can not get success.

@straydogstudio
Copy link
Collaborator

@joelGarcia93 Did you see Issue #107 listed above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants