Add users controller
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2025-03-14 16:37:21 +01:00
parent 50280ce389
commit 026bda2a99
14 changed files with 110 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ class ContestsController < ApplicationController
def index
@contests = current_user.contests
@user = current_user
end
def show

View File

@@ -0,0 +1,36 @@
class UsersController < ApplicationController
before_action :set_user, only: %i[ destroy edit update show ]
def index
end
def edit
end
def update
if @user.update(user_params)
redirect_to @user
else
render :edit, status: :unprocessable_entity
end
end
def show
end
def new
end
def destroy
end
private
def set_user
@user = User.find(params[:id])
end
def user_params
params.expect(user: [ :username, :email_address ])
end
end