lootban start

This commit is contained in:
2025-02-27 15:47:41 -08:00
parent 2c0f09455e
commit 0e380931b1
12 changed files with 91 additions and 53 deletions

View File

@ -54,4 +54,16 @@ class AdminController < ApplicationController
session.delete(:user_id)
redirect_to root_path, notice: "Logged out!"
end
def set_lootban(name)
if Lootban.count == 0
Lootban.create(name: name)
else
Lootban.first.name = name
end
end
def delete_lootban
Lootban.delete_all
end
end

View File

@ -1,5 +1,6 @@
class LeaderboardController < ApplicationController
def index
@players = Player.where(main_player_id: nil).order(purse: :desc)
@lootban = Lootban.first&.name || "Nobody... yet"
end
end