Ember temp commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
module Suppliers
|
||||
class OrdersController < Suppliers::ApplicationController
|
||||
# GET /tables
|
||||
# GET /tables.json
|
||||
def index
|
||||
if params[:state] == 'active'
|
||||
@orders = Order.active_for_supplier(current_supplier.id)
|
||||
else
|
||||
@orders = Order.for_supplier(current_supplier, page: params[:page], per_page: params['per_page'] || 10)
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: {orders: @orders.map(&:with_products_as_json)} }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user