Class: Logistics::Core::BreakBulkTruckAssignmentsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Logistics::Core::BreakBulkTruckAssignmentsController
- Defined in:
- app/controllers/logistics/core/break_bulk_truck_assignments_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /break_bulk_truck_assignments POST /break_bulk_truck_assignments.json.
-
#index ⇒ Object
GET /break_bulk_truck_assignments GET /break_bulk_truck_assignments.json.
-
#update ⇒ Object
PATCH/PUT /break_bulk_truck_assignments/1 PATCH/PUT /break_bulk_truck_assignments/1.json.
Instance Method Details
#create ⇒ Object
POST /break_bulk_truck_assignments POST /break_bulk_truck_assignments.json
19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/logistics/core/break_bulk_truck_assignments_controller.rb', line 19 def create break_bulk_truck_assignment = BreakBulkTruckAssignment.new(break_bulk_truck_assignment_params) if break_bulk_truck_assignment.save response = Mks::Common::MethodResponse.new(true, "Break Bulk Truck Type Assignment record saved successfully!",break_bulk_truck_assignment, nil, nil) else errors = Mks::Common::Util. break_bulk_truck_assignment, "Break Bulk Truck Assignment" response = Mks::Common::MethodResponse.new(false, nil, nil, errors, nil) end render json: response end |
#index ⇒ Object
GET /break_bulk_truck_assignments GET /break_bulk_truck_assignments.json
11 12 13 14 15 |
# File 'app/controllers/logistics/core/break_bulk_truck_assignments_controller.rb', line 11 def index @break_bulk_truck_assignments = BreakBulkTruckAssignment.fetch_all response = Mks::Common::MethodResponse.new(true, nil, @break_bulk_truck_assignments, nil, nil) render json: response end |
#update ⇒ Object
PATCH/PUT /break_bulk_truck_assignments/1 PATCH/PUT /break_bulk_truck_assignments/1.json
32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/logistics/core/break_bulk_truck_assignments_controller.rb', line 32 def update break_bulk_truck_assignment = set_break_bulk_truck_assignment if break_bulk_truck_assignment.update(break_bulk_truck_assignment_params) response = Mks::Common::MethodResponse.new(true, "Break Bulk Truck Type Assignment record updated successfully!", break_bulk_truck_assignment, nil, nil) else errors = Mks::Common::Util. break_bulk_truck_assignment, "Break Bulk Truck Assignment" response = Mks::Common::MethodResponse.new(false, nil, nil, errors, nil) end render json: response end |