In my controller
def upload
@file = params[:file_xlsx]
Category.delay.upload_process(@file.tempfile, params[:id])
redirect_to action: "show", id: params[:id]
end
On My Model
def self.upload_process(file, id)
xlsx = Roo::Excelx.new(file)
.........
end
The error:
undefined method `name' for nil:NilClass
Works perfect without "delayed_job", but does not work with "delayed_job", what can be wrong?