3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'app/controllers/spotlight_search/export_jobs_controller.rb', line 3
def export_job
begin
klass = params[:class_name].constantize
if klass.validate_exportable_columns(params[:columns])
ExportJob.perform_later(klass.name, params[:email], params[:columns], params[:filters], params[:sort])
notice = 'Successfully queued for export'
else
notice = 'Invalid columns found'
end
rescue StandardError => e
notice = e.message
ensure
redirect_back fallback_location: root_path, notice: notice
end
end
|