diff options
author | DavisLWebb <davislwebb@ymail.com> | 2014-03-02 21:14:48 -0500 |
---|---|---|
committer | DavisLWebb <davislwebb@ymail.com> | 2014-03-02 21:14:48 -0500 |
commit | 31444c5a8cf56473a326227932dd36785c905ed1 (patch) | |
tree | d1398492d724eb4d9a32146e87596f7a0fb80622 /app | |
parent | ec0ee835e8671fc5a421b7e7bcb54d4eec6deedb (diff) | |
parent | fefe3f469243d6c932c256cc8798bae35e4ff1c4 (diff) |
Merge branch 'master' of http://github.com/LukeShu/leaguer
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/matches_controller.rb | 2 | ||||
-rw-r--r-- | app/views/matches/_form.html.erb | 4 | ||||
-rw-r--r-- | app/views/matches/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/matches/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/matches/show.html.erb | 5 | ||||
-rw-r--r-- | app/views/matches/show.json.jbuilder | 2 |
6 files changed, 14 insertions, 3 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index e9f3c5a..984be3f 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -69,6 +69,6 @@ class MatchesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def match_params - params.require(:match).permit(:tournament_id) + params.require(:match).permit(:tournament_id, :name) end end diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 34494c3..c5f1ba8 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -15,6 +15,10 @@ <%= f.label :tournament_id %><br> <%= f.text_field :tournament_id %> </div> + <div class="field"> + <%= f.label :name %><br> + <%= f.text_field :name %> + </div> <div class="actions"> <%= f.submit %> </div> diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index d8122ac..0742770 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -4,6 +4,7 @@ <thead> <tr> <th>Tournament</th> + <th>Name</th> <th></th> <th></th> <th></th> @@ -14,6 +15,7 @@ <% @matches.each do |match| %> <tr> <td><%= match.tournament %></td> + <td><%= match.name %></td> <td><%= link_to 'Show', match %></td> <td><%= link_to 'Edit', edit_match_path(match) %></td> <td><%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %></td> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index c8ada7a..08ae0ef 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 + json.extract! match, :id, :tournament_id, :name 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 7bab721..0b02ae7 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -5,5 +5,10 @@ <%= @match.tournament %> </p> +<p> + <strong>Name:</strong> + <%= @match.name %> +</p> + <%= link_to 'Edit', edit_match_path(@match) %> | <%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index 2e45395..128550f 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :tournament_id, :created_at, :updated_at +json.extract! @match, :id, :tournament_id, :name, :created_at, :updated_at |