Class: LabwhereReceptionsController

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

Constant Summary

Constants included from FlashTruncation

FlashTruncation::STRING_OVERHEAD

Instance Method Summary collapse

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

#createObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/labwhere_receptions_controller.rb', line 9

def create
  # user_barcode,location_barcode,asset_barcodes
  input = params[:labwhere_reception] || {}

  @labwhere_reception = LabwhereReception.new(input[:user_code], input[:location_barcode], input[:barcodes])
  if @labwhere_reception.save
    flash.now[:notice] = 'Locations updated!'
  else
    flash.now[:error] = @labwhere_reception.errors.full_messages.join('; ')
  end
end

#indexObject



5
6
7
# File 'app/controllers/labwhere_receptions_controller.rb', line 5

def index
  @labwhere_reception = LabwhereReception.new(params[:user_code], params[:location_barcode], [])
end