Sha256: 838f8a3d4d6be7d77c845b233830e0cf7de270a65fe1194dc6e8ec61a49c3b80
Contents?: true
Size: 769 Bytes
Versions: 4
Compression:
Stored size: 769 Bytes
Contents
module SpotlightSearch class ExportJobsController < ApplicationController def export_job begin klass = params[:class_name].constantize if klass.validate_exportable_columns(params[:columns]) (filter_params = params[:filters].permit!) if params[:filters].present? (sort_params = params[:sort].permit!) if params[:sort].present? ExportJob.perform_later(klass.name, params[:email], params[:columns], filter_params, sort_params) 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 end end
Version data entries
4 entries across 4 versions & 1 rubygems