Class: Logistics::Core::AgencyCategoriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Logistics::Core::AgencyCategoriesController
- Defined in:
- app/controllers/logistics/core/agency_categories_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /agency_categories POST /agency_categories.json.
-
#index ⇒ Object
GET /agency_categories GET /agency_categories.json.
-
#update ⇒ Object
PATCH/PUT /agency_categories/1 PATCH/PUT /agency_categories/1.json.
Instance Method Details
#create ⇒ Object
POST /agency_categories POST /agency_categories.json
16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/logistics/core/agency_categories_controller.rb', line 16 def create @agency_category = AgencyCategory.new(agency_category_params) if @agency_category.save response = Mks::Common::MethodResponse.new(true, "Agency Category information saved successfully!", @agency_category, nil, nil) else errors = Mks::Common::Util. @agency_category, "Agency Category" response = Mks::Common::MethodResponse.new(false, nil, nil, errors, nil) end render json: response end |
#index ⇒ Object
GET /agency_categories GET /agency_categories.json
8 9 10 11 12 |
# File 'app/controllers/logistics/core/agency_categories_controller.rb', line 8 def index agency_categories = AgencyCategory.all response = Mks::Common::MethodResponse.new(true, nil, agency_categories, nil, nil) render json: response end |
#update ⇒ Object
PATCH/PUT /agency_categories/1 PATCH/PUT /agency_categories/1.json
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/logistics/core/agency_categories_controller.rb', line 29 def update if @agency_category.update(agency_category_params) response = Mks::Common::MethodResponse.new(true, "Agency Category information updated successfully!", @agency_category, nil, nil) else errors = Mks::Common::Util. @agency_category, "Agency Category" response = Mks::Common::MethodResponse.new(false, nil, nil, errors, nil) end render json: response end |