Setup I18n for titles
This commit is contained in:
@@ -6,13 +6,13 @@ class ContestsController < ApplicationController
|
||||
authorize :contest
|
||||
|
||||
@contests = current_user.contests
|
||||
@title = "Welcome #{current_user.username}!"
|
||||
@title = I18n.t("contests.index.title", username: current_user.username)
|
||||
end
|
||||
|
||||
def show
|
||||
authorize @contest
|
||||
|
||||
@title = @contest.name
|
||||
@title = I18n.t("contests.show.title", name: @contest.name)
|
||||
@contestants = @contest.contestants.order(:name)
|
||||
@puzzles = @contest.puzzles.order(:id)
|
||||
set_badges
|
||||
@@ -20,15 +20,12 @@ class ContestsController < ApplicationController
|
||||
|
||||
def edit
|
||||
authorize @contest
|
||||
|
||||
@title = "Edit contest settings"
|
||||
end
|
||||
|
||||
def new
|
||||
authorize :contest
|
||||
|
||||
@contest = Contest.new
|
||||
@title = "New jigsaw puzzle competition"
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -65,7 +62,7 @@ class ContestsController < ApplicationController
|
||||
end
|
||||
authorize @contest
|
||||
|
||||
@title = @contest.name
|
||||
@title = I18n.t("contests.scoreboard.title", name: @contest.name)
|
||||
@contestants = @contest.contestants.order(:name)
|
||||
@puzzles = @contest.puzzles.order(:id)
|
||||
render :scoreboard
|
||||
|
||||
Reference in New Issue
Block a user