Class: SampleManifestUploadWithTagSequencesController
Constant Summary
FlashTruncation::STRING_OVERHEAD
Instance Method Summary
collapse
#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!
#max_flash_size, #truncate_flash, #truncate_flash_array
Instance Method Details
#create ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/sample_manifest_upload_with_tag_sequences_controller.rb', line 9
def create
if params[:upload].present?
@uploader = create_uploader
if @uploader.run!
success('Sample manifest successfully uploaded.')
else
error('Your sample manifest couldn\'t be uploaded.')
end
else
error('No file attached')
end
end
|
#create_uploader ⇒ Object
#error(message) ⇒ Object
34
35
36
37
38
|
# File 'app/controllers/sample_manifest_upload_with_tag_sequences_controller.rb', line 34
def error(message)
flash.now[:error] = message
render :new
end
|
#new ⇒ Object
5
6
7
|
# File 'app/controllers/sample_manifest_upload_with_tag_sequences_controller.rb', line 5
def new
end
|
rubocop:todo Metrics/MethodLength
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'app/controllers/sample_manifest_upload_with_tag_sequences_controller.rb', line 40
def pending_sample_manifests =
SampleManifest
.pending_manifests
.includes(:study, :supplier, :user, :uploaded_document)
.paginate(page: params[:page])
completed_sample_manifests =
SampleManifest
.completed_manifests
.includes(:study, :supplier, :user, :uploaded_document)
.paginate(page: params[:page])
@display_manifests = pending_sample_manifests | completed_sample_manifests
@sample_manifests = SampleManifest.paginate(page: params[:page])
end
|
#success(message) ⇒ Object
27
28
29
30
31
32
|
# File 'app/controllers/sample_manifest_upload_with_tag_sequences_controller.rb', line 27
def success(message)
flash[:notice] = message
redirect_target = (@uploader.study.present? ? sample_manifests_study_path(@uploader.study) : sample_manifests_path)
redirect_to redirect_target
end
|