Organise with layouts
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 08:44:08 +01:00
parent 54b25a061e
commit caa45332b0
13 changed files with 61 additions and 47 deletions

View File

@@ -2,4 +2,16 @@ class ApplicationController < ActionController::Base
include Authentication
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern
before_action :set_title, :set_current_user
layout "authenticated"
private
def set_title
@title = "Public scoreboard"
end
def set_current_user
@current_user = current_user
end
end

View File

@@ -3,14 +3,16 @@ class ContestsController < ApplicationController
def index
@contests = current_user.contests
@user = current_user
@title = "Welcome #{current_user.username}!"
end
def show
@title = "Contest: #{@contest.name}"
end
def new
@contest = Contest.new
@title = "Create a new jigsaw puzzle competition"
end
def create

View File

@@ -2,9 +2,11 @@ class UsersController < ApplicationController
before_action :set_user, only: %i[ destroy edit update show ]
def index
@title = "All users"
end
def edit
@title = "My settings"
end
def update
@@ -16,6 +18,7 @@ class UsersController < ApplicationController
end
def show
redirect_to edit_user_path(@user)
end
def new