Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
12345678910111213141516class Api::V3::UsersController < Api::V3::ApplicationController before_action :set_user, only: [:show]
def show render json: @user, serializer: Api::V3::UserSerializer, root: :user end
private
def set_user @user = User.find_by(name: params[:id]) || User.find(params[:id]) rescue ActiveRecord::RecordNotFound render status: 404, json: {status: 404, message: "User with name or id '#{params[:id]}' not found."} endend