Class: LabwhereReceptionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/labwhere_receptions_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


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

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


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

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