Class: Api::V1::ClientsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/api/v1/clients_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



2
3
4
5
6
7
8
9
# File 'app/controllers/api/v1/clients_controller.rb', line 2

def index
  @clients = Client.order("name")
  unless admin?
    @clients = @clients.for_user(current_user)
  end
  @clients = @clients.where(:initials => params[:initials]) unless params[:initials].blank?
  render :json => @clients
end