lootban start
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
2
app/models/lootban.rb
Normal file
2
app/models/lootban.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class Lootban < ApplicationRecord
|
||||
end
|
@ -38,5 +38,5 @@
|
||||
<% end %>
|
||||
|
||||
<h1>Current Loot Ban:</h1>
|
||||
<h1 class="goofy-text">Belien</h1>
|
||||
<h1 class="goofy-text"><%= @lootban %></h1>
|
||||
|
||||
|
Reference in New Issue
Block a user