Files
sx-fc/app/controllers/api/customers_controller.rb
2017-06-09 09:29:25 +06:30

18 lines
359 B
Ruby

class Api::CustomersController < ActionController::API
#List all active customers by name
def index
@customers = Customer.order("name asc")
end
#Show customer by ID
def show
@customer = Customer.find_by(params[:id])
end
#Show customer detail by Order item
def get_customer_order
@customer = Customer.find(params[:id])
end
end