diff options
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_form.html.erb | 4 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/tournaments/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 5 | ||||
-rw-r--r-- | app/views/tournaments/show.json.jbuilder | 2 |
5 files changed, 13 insertions, 2 deletions
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 8996266..1fd63e9 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -11,6 +11,10 @@ </div> <% end %> + <div class="field"> + <%= f.label :game_id %><br> + <%= f.text_field :game_id %> + </div> <div class="actions"> <%= f.submit %> </div> diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 7124111..ad2b7cf 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -3,6 +3,7 @@ <table> <thead> <tr> + <th>Game</th> <th></th> <th></th> <th></th> @@ -12,6 +13,7 @@ <tbody> <% @tournaments.each do |tournament| %> <tr> + <td><%= tournament.game %></td> <td><%= link_to 'Show', tournament %></td> <td><%= link_to 'Edit', edit_tournament_path(tournament) %></td> <td><%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %></td> diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index 28d6960..e6f3b49 100644 --- a/app/views/tournaments/index.json.jbuilder +++ b/app/views/tournaments/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@tournaments) do |tournament| - json.extract! tournament, :id + json.extract! tournament, :id, :game_id json.url tournament_url(tournament, format: :json) end diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index 2c280ba..30df788 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -1,4 +1,9 @@ <p id="notice"><%= notice %></p> +<p> + <strong>Game:</strong> + <%= @tournament.game %> +</p> + <%= link_to 'Edit', edit_tournament_path(@tournament) %> | <%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder index 211799a..0fe65a6 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :created_at, :updated_at +json.extract! @tournament, :id, :game_id, :created_at, :updated_at |