diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/matches_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index b50aca5..254f797 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -3,6 +3,8 @@ class MatchesController < ApplicationController require 'json' require 'delayed_job' + before_action :set_tournament, only: [:index] + # GET /tournaments/1/matches # GET /tournaments/1/matches.json def index @@ -236,6 +238,9 @@ class MatchesController < ApplicationController @match = Match.find(params[:id]) @tournament = @match.tournament_stage.tournament end + def set_tournament + @tournament = Tournament.find(params[:tournament_id]) + end # Never trust parameters from the scary internet, only allow the white list through. def match_params |