From 3f6f212c1d50a0ae953104524ceffe94095307cf Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Thu, 6 Mar 2014 21:22:15 -0500 Subject: tournament controller to matches redirect --- app/controllers/tournaments_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 6fc3ad6..3f6de26 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -11,12 +11,16 @@ class TournamentsController < ApplicationController # GET /tournaments/1 # GET /tournaments/1.json def show + unless @tournament.status + redirect_to tournament_matches_page(@tournament) + end end # GET /tournaments/new def new @games = Game.all @tournament = Tournament.new(game: Game.find_by_id(params[:game])) + @tournament.status = 1 end # GET /tournaments/1/edit -- cgit v1.2.3-2-g168b