1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added button to generate matches

This commit is contained in:
2015-05-26 17:53:53 +00:00
parent e62fb1a514
commit 81f233cb0e
4 changed files with 24 additions and 0 deletions

View File

@@ -85,4 +85,17 @@ class StaticPagesController < ApplicationController
@tournament = Tournament.find(params[:tournament])
end
end
def generate_matches
if user_signed_in?
else
redirect_to root_path
end
if params[:tournament]
@tournament = Tournament.find(params[:tournament])
end
if @tournament
@tournament.generateMatchups
end
end
end

View File

@@ -0,0 +1,3 @@
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
<br>
Done!

View File

@@ -29,7 +29,13 @@
<strong>Tournament Type:</strong>
<%= @tournament.tournament_type %>
</p>
<br>
<br>
<% if user_signed_in? %>
<br>
<%= link_to "Generate Pool Matches" , "/static_pages/generate_matches?tournament=#{@tournament.id}", :class=>"btn btn-danger" %>
<% end %>
<br>
<br>
<h3>School Lineups</h3>

View File

@@ -32,6 +32,8 @@ Wrestling::Application.routes.draw do
get 'static_pages/team_scores'
get 'static_pages/noMatches'
get 'static_pages/createCustomWeights'
get 'static_pages/generate_matches'
# Example of regular route:
# get 'products/:id' => 'catalog#view'