diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 7bcefe4..bc3b687 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -27,8 +27,8 @@ class MatchesController < ApplicationController @match = Match.find (params[:match]) end if @match - @w1 = Wrestler.find(@match.r_id) - @w2 = Wrestler.find(@match.g_id) + @w1 = Wrestler.find(@match.w1) + @w2 = Wrestler.find(@match.w2) end end @@ -92,6 +92,6 @@ class MatchesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def match_params - params.require(:match).permit(:r_id, :g_id, :g_stat, :r_stat, :winner_id, :win_type, :score, :finished) + params.require(:match).permit(:w1, :w2, :g_stat, :r_stat, :winner_id, :win_type, :score, :finished) end end diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index e85d0c4..55ac453 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -12,12 +12,12 @@ <% end %>
R: - <%= @match.r_id %> + <%= @match.w1_name %>
G: - <%= @match.g_id %> + <%= @match.w2_name %>