Class: Logistics::Core::BreakBulkUnitsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Logistics::Core::BreakBulkUnitsController
- Defined in:
- app/controllers/logistics/core/break_bulk_units_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /break_bulk_units POST /break_bulk_units.json.
-
#index ⇒ Object
GET /break_bulk_units GET /break_bulk_units.json.
-
#update ⇒ Object
PATCH/PUT /break_bulk_units/1 PATCH/PUT /break_bulk_units/1.json.
Instance Method Details
#create ⇒ Object
POST /break_bulk_units POST /break_bulk_units.json
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/logistics/core/break_bulk_units_controller.rb', line 16 def create @break_bulk_unit = BreakBulkUnit.new(break_bulk_unit_params) if @break_bulk_unit.valid? @break_bulk_unit.save @response = Mks::Common::MethodResponse.new(true,'Break bulk unit recorded successfully',nil,nil,nil) render json: @response else errors = Mks::Common::Util. @break_bulk_unit, 'Break Bulk Unit' @response = Mks::Common::MethodResponse.new(false,nil,nil,errors,nil) render json: @response end end |
#index ⇒ Object
GET /break_bulk_units GET /break_bulk_units.json
8 9 10 11 12 |
# File 'app/controllers/logistics/core/break_bulk_units_controller.rb', line 8 def index @break_bulk_units = BreakBulkUnit.all response = Mks::Common::MethodResponse.new(true,nil,@break_bulk_units,nil,nil) render json: response end |
#update ⇒ Object
PATCH/PUT /break_bulk_units/1 PATCH/PUT /break_bulk_units/1.json
32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/logistics/core/break_bulk_units_controller.rb', line 32 def update if @break_bulk_unit.update_attributes(break_bulk_unit_params) @break_bulk_unit.save @response = Mks::Common::MethodResponse.new(true,'Break bulk unit updated successfully',nil,nil,nil) render json: @response else errors = Mks::Common::Util. @break_bulk_unit, 'Break Bulk Unit' @response = Mks::Common::MethodResponse.new(false,nil,nil,errors,nil) render json: @response end end |