mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
28 lines
597 B
Ruby
28 lines
597 B
Ruby
class StaticPagesController < ApplicationController
|
|
|
|
def index
|
|
@tournaments = Tournament.all
|
|
end
|
|
|
|
def brackets
|
|
if params[:weight]
|
|
@weight = Weight.find(params[:weight])
|
|
@wrestlers = Wrestler.where(weight_id: @weight.id)
|
|
@seed1 = Wrestler.where(weight_id: @weight.id, original_seed: 1).first
|
|
end
|
|
#@seed1 = @wrestlers.where(original_seed: 1).name
|
|
|
|
|
|
end
|
|
|
|
def weights
|
|
if params[:tournament]
|
|
@tournament = Tournament.find(params[:tournament])
|
|
end
|
|
if @tournament
|
|
@weights = Weight.where(tournament_id: @tournament.id)
|
|
end
|
|
end
|
|
|
|
end
|