Sha256: 3a717564bc29a92664de1e38e256807c7c7c664e55b6e25abd5061ffc92304a3

Contents?: true

Size: 599 Bytes

Versions: 4

Compression:

Stored size: 599 Bytes

Contents

module SpotlightSearch
  class ExportJobsController < ApplicationController
    def export_job
      begin
        klass = params[:klass].constantize
        if klass.validate_exportable_columns(params[:columns])
          ExportJob.perform_later(params[:email], klass.to_s, params[:columns], params[:filters])
          flash[:success] = 'Successfully queued for export'
        else
          flash[:error] = 'Invalid columns found'
        end
      rescue
        flash[:error] = 'No records to import'
      ensure
        redirect_back fallback_location: root_path
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spotlight_search-0.1.9 app/controllers/spotlight_search/export_jobs_controller.rb
spotlight_search-0.1.8 app/controllers/spotlight_search/export_jobs_controller.rb
spotlight_search-0.1.7 app/controllers/spotlight_search/export_jobs_controller.rb
spotlight_search-0.1.6 app/controllers/spotlight_search/export_jobs_controller.rb