Class: Mks::Rent::OfferItemsController
- Inherits:
-
ApplicationController
- Object
- Auth::ApplicationController
- ApplicationController
- Mks::Rent::OfferItemsController
- Defined in:
- app/controllers/mks/rent/offer_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/offer_items_controller.rb', line 15 def create @offer_item = OfferItem.new(offer_item_params) if @offer_item.save render json: @offer_item, status: :created, location: @offer_item else render json: @offer_item.errors, status: :unprocessable_entity end end |
#destroy ⇒ Object
33 34 35 |
# File 'app/controllers/mks/rent/offer_items_controller.rb', line 33 def destroy @offer_item.destroy end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/mks/rent/offer_items_controller.rb', line 6 def index offer_items = Mks::Common::MethodResponse(OfferItem.all) render json: offer_items end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/mks/rent/offer_items_controller.rb', line 11 def show render json: @offer_item end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/mks/rent/offer_items_controller.rb', line 25 def update if @offer_item.update(offer_item_params) render json: @offer_item else render json: @offer_item.errors, status: :unprocessable_entity end end |