Add team switch
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-15 12:44:58 +01:00
parent 1dbb495c3b
commit 1f0cbee9fd
8 changed files with 35 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
class ContestsController < ApplicationController
before_action :set_contest, only: %i[ show destroy ]
before_action :set_contest, only: %i[ destroy edit show update ]
def index
@contests = current_user.contests
@@ -7,7 +7,11 @@ class ContestsController < ApplicationController
end
def show
@title = "Contest: #{@contest.name}"
@title = @contest.name
end
def edit
@title = "Edit contest settings"
end
def new
@@ -25,6 +29,14 @@ class ContestsController < ApplicationController
end
end
def update
if @contest.update(contest_params)
redirect_to @contest
else
render :edit, status: :unprocessable_entity
end
end
def destroy
end

View File

@@ -1,5 +1,5 @@
class UsersController < ApplicationController
before_action :set_user, only: %i[ destroy edit update show ]
before_action :set_user, only: %i[ destroy edit show update ]
def index
@title = "All users"