Class: Workarea::Api::Admin::ShippingsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/workarea/api/admin/shippings_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #sort_direction, #sort_field

Instance Method Details

#indexObject



52
53
54
55
56
57
58
59
# File 'app/controllers/workarea/api/admin/shippings_controller.rb', line 52

def index
  @shippings = Shipping
                  .all
                  .order_by(sort_field => sort_direction)
                  .page(params[:page])

  respond_with shippings: @shippings
end

#showObject



98
99
100
101
# File 'app/controllers/workarea/api/admin/shippings_controller.rb', line 98

def show
  @shipping = Shipping.find(params[:id])
  respond_with shipping: @shipping
end