add new file

This commit is contained in:
Sunandar
2017-02-03 17:56:43 +06:30
parent 538c898e06
commit cccf9c0e9b
21 changed files with 369 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
class Api::ClientsController < ApplicationController
skip_before_filter :verify_authenticity_token
def index
session_token=params[:session_token]
check_member= Member.authenticate_session_token(session_token)
if !check_member.nil?
clients =Client.all
arr_client=Array.new
clients.each do |client|
str={:id => client.id,:name => client.name,:email => client.email,:phone => client.phone,:address => client.address,:product_type => client.product_type}
arr_client.push(str)
end
@out=true,arr_client
else
@out=false,"Sorry!Unauthorized user!"
end
end
end