Files
euchre_camp/app/actions/players/rankings.rb
T
david cb47b9da99 refactor: update rankings action to pass current_player
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
2026-03-27 12:25:27 -07:00

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