diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 39d31b8..68db85e 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -13,7 +13,7 @@ class TournamentsController < ApplicationController @wrestler = Wrestler.find(params[:wrestler][:originalId]) respond_to do |format| if SwapWrestlers.new.swap_wrestlers_bracket_lines(params[:wrestler][:originalId], params[:wrestler][:swapId]) - format.html { redirect_to "/tournaments/#{@wrestler.tournament.id}/brackets/#{@wrestler.weight.id}", notice: 'Wrestler was successfully swaped.' } + format.html { redirect_to "/tournaments/#{@wrestler.tournament.id}/brackets/#{@wrestler.weight.id}", notice: 'Wrestlers successfully swapped.' } format.json { render action: 'show', status: :created, location: @wrestler } end end @@ -149,7 +149,8 @@ class TournamentsController < ApplicationController def all_brackets - + @schools = @tournament.schools + @schools = @schools.sort_by{|s| s.page_score_string}.reverse! end def bracket diff --git a/app/views/tournaments/all_brackets.html.erb b/app/views/tournaments/all_brackets.html.erb index 1257a77..215be07 100644 --- a/app/views/tournaments/all_brackets.html.erb +++ b/app/views/tournaments/all_brackets.html.erb @@ -71,6 +71,7 @@ li:first-child,li:last-child {
| Name | @@ -12,7 +13,7 @@||
|---|---|---|
| <%= school.name %> (<%= school.abbreviation %>) | +<%= @schools.index(school) + 1 %>. <%= school.name %> (<%= school.abbreviation %>) | <%= school.page_score_string %> |