Class: Api::V2::Heron::TubeRackStatusesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/api/v2/heron/tube_rack_statuses_controller.rb

Overview

Endpoint to create TubeRackStatuses

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


11
12
13
14
15
16
17
18
# File 'app/controllers/api/v2/heron/tube_rack_statuses_controller.rb', line 11

def create
  tube_rack_status_factory = ::Heron::Factories::TubeRackStatus.new(tube_rack_status_params)
  if tube_rack_status_factory.save
    render json: {}, status: :created
  else
    render json: { errors: tube_rack_status_factory.errors.full_messages }, status: :unprocessable_entity
  end
end