Class: GetYourQcCompletedTubesHereController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #clean_params_from_check, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!

Instance Method Details

#createObject


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/get_your_qc_completed_tubes_here_controller.rb', line 7

def create
  @generator = LibPoolNormTubeGenerator.new(params[:barcode], current_user, Study.find_by(name: 'Lib PCR-XP QC Completed Tubes'))
  if @generator.valid?
    if @generator.create!
      flash[:notice] = "QC Completed tubes successfully created for #{@generator.plate.human_barcode}. 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.full_messages.join(', ')
    render :new
  end
end

#newObject


4
5
# File 'app/controllers/get_your_qc_completed_tubes_here_controller.rb', line 4

def new
end