Class: Workarea::Api::Admin::LegacyOrdersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Workarea::Api::Admin::LegacyOrdersController
- Defined in:
- app/controllers/workarea/api/admin/legacy_orders_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/controllers/workarea/api/admin/legacy_orders_controller.rb', line 15 def create @order = LegacyOrder.create!(params[:order]) respond_with( { order: @order }, status: :created, location: legacy_order_path(@order.id) ) end |
#index ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'app/controllers/workarea/api/admin/legacy_orders_controller.rb', line 6 def index @orders = LegacyOrder .all .order_by(sort_field => sort_direction) .page(params[:page]) respond_with orders: @orders end |
#show ⇒ Object
24 25 26 27 |
# File 'app/controllers/workarea/api/admin/legacy_orders_controller.rb', line 24 def show @order = LegacyOrder.find(params[:id]) respond_with order: @order end |
#update ⇒ Object
29 30 31 32 33 |
# File 'app/controllers/workarea/api/admin/legacy_orders_controller.rb', line 29 def update @order = LegacyOrder.find(params[:id]) @order.update_attributes!(params[:order]) respond_with order: @order end |