Class: Mks::Rent::RequestItemsController
- Inherits:
-
ApplicationController
- Object
- Auth::ApplicationController
- ApplicationController
- Mks::Rent::RequestItemsController
- Defined in:
- app/controllers/mks/rent/request_items_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/mks/rent/request_items_controller.rb', line 15 def create @request_item = RequestItem.new(request_item_params) if @request_item.save render json: @request_item, status: :created, location: @request_item else render json: @request_item.errors, status: :unprocessable_entity end end |
#destroy ⇒ Object
33 34 35 |
# File 'app/controllers/mks/rent/request_items_controller.rb', line 33 def destroy @request_item.destroy end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/mks/rent/request_items_controller.rb', line 6 def index request_items = RequestItem.all render json: request_items end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/mks/rent/request_items_controller.rb', line 11 def show render json: @request_item end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/mks/rent/request_items_controller.rb', line 25 def update if @request_item.update(request_item_params) render json: @request_item else render json: @request_item.errors, status: :unprocessable_entity end end |