summaryrefslogtreecommitdiffhomepage
path: root/app/controllers/api/v1/users_controller.rb
blob: ad27ad6286956420531a3d69ad85f707d65fbec6 (plain)
1
2
3
4
5
6
7
8
9
10
class Api::V1::UsersController < ApplicationController
  def index
    # return list of all users
    users = User.all.order(created_at: :desc)
    #render json: users.to_json(only: [:name])
    #render json: users.to_json(only: [:user])
    #render json: users.to_json(only: { only: [:name] })
    render json: users.to_json(include: [games: { only: [:title, :titleSlug] }])
  end
end