Files

14 lines
368 B
Ruby

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