summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/matches/_form.html.erb4
-rw-r--r--app/views/matches/index.html.erb3
-rw-r--r--app/views/matches/index.json.jbuilder2
-rw-r--r--app/views/matches/show.html.erb5
-rw-r--r--app/views/matches/show.json.jbuilder2
5 files changed, 14 insertions, 2 deletions
diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb
index 015aed0..3efb566 100644
--- a/app/views/matches/_form.html.erb
+++ b/app/views/matches/_form.html.erb
@@ -1,6 +1,10 @@
<%= form_for([@tournament, @tournament.matches.build]) do |f| %>
<div class="field">
+ <%= f.label :status %><br>
+ <%= f.number_field :status %>
+ </div>
+ <div class="field">
<%= f.label :tournament_id %><br>
<%= f.text_field :tournament_id %>
</div>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index 60df1b5..d862d57 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -3,6 +3,7 @@
<table>
<thead>
<tr>
+ <th>Status</th>
<th>Tournament</th>
<th>Name</th>
<th>Winner</th>
@@ -16,6 +17,8 @@
<% @tournament.matches.each do |match| %>
<tr>
<td><%= match.tournament.id %></td>
+ <td><%= match.status %></td>
+ <td><%= match.tournament %></td>
<td><%= match.name %></td>
<td><%= match.winner %></td>
<td><%= link_to 'Show', tournament_match_path(@tournament, match) %></td>
diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder
index 0b2bfcd..1a63f5f 100644
--- a/app/views/matches/index.json.jbuilder
+++ b/app/views/matches/index.json.jbuilder
@@ -1,4 +1,4 @@
json.array!(@matches) do |match|
- json.extract! match, :id, :tournament_id, :name, :winner_id
+ json.extract! match, :id, :status, :tournament_id, :name, :winner_id
json.url match_url(match, format: :json)
end
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index b6930ea..6b962ad 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -1,4 +1,9 @@
<p>
+ <strong>Status:</strong>
+ <%= @match.status %>
+</p>
+
+<p>
<strong>Tournament:</strong>
<%= @match.tournament.id %>
</p>
diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder
index fe14010..a3ef588 100644
--- a/app/views/matches/show.json.jbuilder
+++ b/app/views/matches/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @match, :id, :tournament_id, :name, :winner_id, :created_at, :updated_at
+json.extract! @match, :id, :status, :tournament_id, :name, :winner_id, :created_at, :updated_at