class ReportsController < ApplicationController def index @reports = Report.order(created_at: :desc).limit(10) end def create inn = params[:inn] report = Report.create!(inn: inn, status: 'processing') FileProcessorJob.perform_async(inn, report.id) redirect_to reports_path, notice: 'Отчёт загружается в фоне' end end