Class: NtqExcelsiorEngine::ImportersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ntq_excelsior_engine/importers_controller.rb

Instance Method Summary collapse

Instance Method Details

#sample_fileObject



10
11
12
13
14
# File 'app/controllers/ntq_excelsior_engine/importers_controller.rb', line 10

def sample_file
  return render nothing: true, status: 404 unless @importer.to_s.constantize.sample_file.present?
  
  send_file "#{Rails.root}/#{@importer.to_s.constantize.sample_file}", disposition: 'attachment'
end

#showObject



5
6
7
8
# File 'app/controllers/ntq_excelsior_engine/importers_controller.rb', line 5

def show
  @importer = @importer.to_s.constantize
  render layout: false
end