1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-04 05:43:47 +00:00

Added an edit wrestlers page for matches

This commit is contained in:
2020-01-14 12:46:02 -05:00
parent e4329e3519
commit d4dedfb3bd
9 changed files with 298 additions and 235 deletions

View File

@@ -1,6 +1,6 @@
class MatchesController < ApplicationController
before_action :set_match, only: [:show, :edit, :update, :destroy]
before_action :check_access, only: [:edit,:update]
before_action :set_match, only: [:show, :edit, :update, :destroy, :stat]
before_action :check_access, only: [:edit,:update, :stat]
# GET /matches/1
# GET /matches/1.json
@@ -11,6 +11,16 @@ class MatchesController < ApplicationController
# GET /matches/1/edit
def edit
if params[:match]
@match = Match.where(:id => params[:match]).includes(:wrestlers).first
end
if @match
@wrestlers = @match.weight.wrestlers
end
session[:return_path] = "/tournaments/#{@match.tournament.id}/matches"
end
def stat
if params[:match]
@match = Match.where(:id => params[:match]).includes(:wrestlers).first
end