From 2a8545f11267de06447b3c56d8beca8d27596dab Mon Sep 17 00:00:00 2001 From: realtradam Date: Sat, 29 Jun 2024 18:30:20 -0400 Subject: work on rendering games --- rails-backend/app/controllers/api/v1/games_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'rails-backend/app/controllers/api') diff --git a/rails-backend/app/controllers/api/v1/games_controller.rb b/rails-backend/app/controllers/api/v1/games_controller.rb index 4346244..2d5e98a 100644 --- a/rails-backend/app/controllers/api/v1/games_controller.rb +++ b/rails-backend/app/controllers/api/v1/games_controller.rb @@ -39,8 +39,7 @@ class Api::V1::GamesController < ApplicationController # list of all games def index game = Game.all.order(created_at: :desc) - #render json: game - render json: game.to_json(include: [:game_files, :card_img, :char_img, :title_img, :tags]) + render json: game.to_json(include: [tags: { only: [:tag_type, :name] }, user: { only: [:user_name, :id] }], except: [:user_id]) end # single game or list of user's games -- cgit v1.2.3