cb47b9da99
Refactor rankings action to use render_with_player helper for consistent current_player availability across views. Changes: - Update rankings action to use render_with_player - Ensure current_player is available in all view templates
18 lines
435 B
Ruby
18 lines
435 B
Ruby
# frozen_string_literal: true
|
|
|
|
module EuchreCamp
|
|
module Actions
|
|
module Players
|
|
class Rankings < EuchreCamp::Action
|
|
include Deps[repo: 'repositories.players']
|
|
|
|
def handle(request, response)
|
|
# Get all players and sort by current Elo
|
|
players = repo.all.sort_by { |p| -p.current_elo }
|
|
render_with_player(request, response, players: players)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|