Hello
I'm using the version of htmltoword 0.5.1
My controller code
class ReportsController < ApplicationController
respond_to :docx
def run
@report = Report.find(params[:id])
end
def execute
@report = Report.find(params[:id])
@params = params
@user = current_user
if @report.format == 'html'
render @report.template.path
elsif @report.format == 'docx'
file_name = @report.name + '.' + @report.format
render docx: @report.template.path, filename: file_name
elsif @report.format == 'xlsx'
file_name = @report.name + '.' + @report.format
render file: @report.template.path
end
end
end
Reports are created and their templates are downloaded with carrierwave to the folder
/uploads/report_templates/13/REPORT_NAME
But if I use the code I wrote above, then the application gives an error 404.
Tell me how it can be fixed or bypassed?
Hello
I'm using the version of htmltoword 0.5.1
My controller code
Reports are created and their templates are downloaded with carrierwave to the folder
/uploads/report_templates/13/REPORT_NAME
But if I use the code I wrote above, then the application gives an error 404.
Tell me how it can be fixed or bypassed?