0
Rails 5.1
を認識していない、私が持っている:/ application_job.rbアプリ/求人遅延ジョブの方法は、私のGemfileで
gem 'delayed_job'
gem 'delayed_job_active_record'
gem 'daemons'
を、私が持っている:/ create_csvアプリ/求人
class ApplicationJob < ActiveJob::Base
end
を.RB、私が持っている:アプリ/コントローラ/ fw_exports_controller.rで
class CreateCsvJob < ApplicationJob
queue_as :default
def perform(followed_id)
........
end
end
def create_csv
CreateCsvJob.perform_later(params[:followed_id])
redirect_to root_path, notice: t('fw_exports.spreadsheet_export.csv_generation_started')
end
しかし、私はCSVを作成するためのアクションを実行したときに、私は次のエラーを取得する:B、私が持っている
uninitialized constant FwExportsController::CreateCsvJob
しかし、私は別の遅延作用を持っている、それは細かい
を働いていますアプリ/コントローラ/ fw_exports_controller.rbで、私が持っている:/ parse_and_process_spreadsheet_jobアプリ/求人
def process_parsed_spreadsheet
ParseAndProcessSpreadsheetJob.perform_later(params[:temp_file_path], params[:followed_id])
redirect_to root_path, notice: t('fw_exports.file_successfully_imported')
end
を。 rb、私は持っています:
class ParseAndProcessSpreadsheetJob < ApplicationJob
queue_as :default
def perform(temp_file_path, followed_id)
.........
end
end
後者は正常に動作します。何か案は?
これが問題を解決しました – EastsideDeveloper