summaryrefslogtreecommitdiffhomepage
path: root/rails-backend/app/controllers/api/v1/users_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'rails-backend/app/controllers/api/v1/users_controller.rb')
-rw-r--r--rails-backend/app/controllers/api/v1/users_controller.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/rails-backend/app/controllers/api/v1/users_controller.rb b/rails-backend/app/controllers/api/v1/users_controller.rb
new file mode 100644
index 0000000..ad27ad6
--- /dev/null
+++ b/rails-backend/app/controllers/api/v1/users_controller.rb
@@ -0,0 +1,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