Class: GetYourQcCompletedTubesHereController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- GetYourQcCompletedTubesHereController
- Defined in:
- app/controllers/get_your_qc_completed_tubes_here_controller.rb
Constant Summary
Constants included from FlashTruncation
FlashTruncation::STRING_OVERHEAD
Instance Method Summary collapse
-
#create ⇒ Object
rubocop:todo Metrics/MethodLength.
- #new ⇒ Object
Methods inherited from ApplicationController
#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!
Methods included from FlashTruncation
#max_flash_size, #truncate_flash, #truncate_flash_array
Instance Method Details
#create ⇒ Object
rubocop:todo Metrics/MethodLength
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/get_your_qc_completed_tubes_here_controller.rb', line 9 def create # rubocop:todo Metrics/AbcSize @generator = LibPoolNormTubeGenerator.new(params[:barcode], current_user, Study.find_by(name: 'Lib PCR-XP QC Completed Tubes')) if @generator.valid? if @generator.create! flash.now[ :notice ] = "QC Completed tubes successfully created for #{@generator.plate.}. Go celebrate!" redirect_to study_asset_groups_path(@generator.study.id) else flash.now[:error] = "Oh dear, your tubes weren't created. It's not you its me so please contact PSD." render :new end else flash.now[:error] = @generator.errors..join(', ') render :new end end |
#new ⇒ Object
5 6 |
# File 'app/controllers/get_your_qc_completed_tubes_here_controller.rb', line 5 def new end |