summaryrefslogtreecommitdiff
path: root/app/views/tournaments
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-02-18 18:16:28 -0500
committerAndrewMurrell <amurrel@purdue.edu>2014-02-18 18:16:28 -0500
commit94a5654371812905c154f29cef393d42f13c5eaa (patch)
tree6bd168b6837f8ae9e4725bc1cdbdfc52cb1f9c5c /app/views/tournaments
parent5f5a3ca46b0c59f698a49de463d72492cfe60f37 (diff)
Added the generate shell command. Please do not commit the generated files.
Diffstat (limited to 'app/views/tournaments')
-rw-r--r--app/views/tournaments/_form.html.erb17
-rw-r--r--app/views/tournaments/edit.html.erb6
-rw-r--r--app/views/tournaments/index.html.erb25
-rw-r--r--app/views/tournaments/index.json.jbuilder4
-rw-r--r--app/views/tournaments/new.html.erb5
-rw-r--r--app/views/tournaments/show.html.erb4
-rw-r--r--app/views/tournaments/show.json.jbuilder1
7 files changed, 62 insertions, 0 deletions
diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb
new file mode 100644
index 0000000..8996266
--- /dev/null
+++ b/app/views/tournaments/_form.html.erb
@@ -0,0 +1,17 @@
+<%= form_for(@tournament) do |f| %>
+ <% if @tournament.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@tournament.errors.count, "error") %> prohibited this tournament from being saved:</h2>
+
+ <ul>
+ <% @tournament.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
diff --git a/app/views/tournaments/edit.html.erb b/app/views/tournaments/edit.html.erb
new file mode 100644
index 0000000..2913025
--- /dev/null
+++ b/app/views/tournaments/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing tournament</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @tournament %> |
+<%= link_to 'Back', tournaments_path %>
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb
new file mode 100644
index 0000000..7124111
--- /dev/null
+++ b/app/views/tournaments/index.html.erb
@@ -0,0 +1,25 @@
+<h1>Listing tournaments</h1>
+
+<table>
+ <thead>
+ <tr>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <% @tournaments.each do |tournament| %>
+ <tr>
+ <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>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
+
+<br>
+
+<%= link_to 'New Tournament', new_tournament_path %>
diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder
new file mode 100644
index 0000000..28d6960
--- /dev/null
+++ b/app/views/tournaments/index.json.jbuilder
@@ -0,0 +1,4 @@
+json.array!(@tournaments) do |tournament|
+ json.extract! tournament, :id
+ json.url tournament_url(tournament, format: :json)
+end
diff --git a/app/views/tournaments/new.html.erb b/app/views/tournaments/new.html.erb
new file mode 100644
index 0000000..2a60539
--- /dev/null
+++ b/app/views/tournaments/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New tournament</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', tournaments_path %>
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
new file mode 100644
index 0000000..2c280ba
--- /dev/null
+++ b/app/views/tournaments/show.html.erb
@@ -0,0 +1,4 @@
+<p id="notice"><%= notice %></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
new file mode 100644
index 0000000..211799a
--- /dev/null
+++ b/app/views/tournaments/show.json.jbuilder
@@ -0,0 +1 @@
+json.extract! @tournament, :id, :created_at, :updated_at