mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-13 16:40:48 +00:00
Updated views for matches
This commit is contained in:
@@ -27,8 +27,8 @@ class MatchesController < ApplicationController
|
|||||||
@match = Match.find (params[:match])
|
@match = Match.find (params[:match])
|
||||||
end
|
end
|
||||||
if @match
|
if @match
|
||||||
@w1 = Wrestler.find(@match.r_id)
|
@w1 = Wrestler.find(@match.w1)
|
||||||
@w2 = Wrestler.find(@match.g_id)
|
@w2 = Wrestler.find(@match.w2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -92,6 +92,6 @@ class MatchesController < ApplicationController
|
|||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def match_params
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,12 +12,12 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label :r_id %><br>
|
<%= f.label :w1_name %><br>
|
||||||
<%= f.number_field :r_id %>
|
<%= f.number_field :w1_name %>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label :g_id %><br>
|
<%= f.label :w2_name %><br>
|
||||||
<%= f.number_field :g_id %>
|
<%= f.number_field :w2_name %>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label :g_stat %><br>
|
<%= f.label :g_stat %><br>
|
||||||
|
|||||||
@@ -19,10 +19,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<% @matches.each do |match| %>
|
<% @matches.each do |match| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= match.r_id %></td>
|
<td><%= match.w1_name %></td>
|
||||||
<td><%= match.g_id %></td>
|
<td><%= match.w2_name %></td>
|
||||||
<td><%= match.g_stat %></td>
|
|
||||||
<td><%= match.r_stat %></td>
|
|
||||||
<td><%= match.winner_id %></td>
|
<td><%= match.winner_id %></td>
|
||||||
<td><%= match.win_type %></td>
|
<td><%= match.win_type %></td>
|
||||||
<td><%= match.score %></td>
|
<td><%= match.score %></td>
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>R:</strong>
|
<strong>R:</strong>
|
||||||
<%= @match.r_id %>
|
<%= @match.w1_name %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>G:</strong>
|
<strong>G:</strong>
|
||||||
<%= @match.g_id %>
|
<%= @match.w2_name %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user