Class: MachineBarcodesController

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

Overview

Used in the flexible cherrypick pipeline layout page

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

#showObject


5
6
7
8
9
10
11
12
# File 'app/controllers/machine_barcodes_controller.rb', line 5

def show
  asset = Labware.with_barcode(params[:id]).first
  summary = asset.present? ? asset.summary_hash : {}
  status = asset.present? ? 200 : 404
  respond_to do |format|
    format.json { render json: summary, status: status }
  end
end