summaryrefslogtreecommitdiff
path: root/app/views/teams
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/teams')
-rw-r--r--app/views/teams/_form.html.erb17
-rw-r--r--app/views/teams/edit.html.erb6
-rw-r--r--app/views/teams/index.html.erb25
-rw-r--r--app/views/teams/index.json.jbuilder4
-rw-r--r--app/views/teams/new.html.erb5
-rw-r--r--app/views/teams/show.html.erb4
-rw-r--r--app/views/teams/show.json.jbuilder1
7 files changed, 62 insertions, 0 deletions
diff --git a/app/views/teams/_form.html.erb b/app/views/teams/_form.html.erb
new file mode 100644
index 0000000..fd10129
--- /dev/null
+++ b/app/views/teams/_form.html.erb
@@ -0,0 +1,17 @@
+<%= form_for(@team) do |f| %>
+ <% if @team.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@team.errors.count, "error") %> prohibited this team from being saved:</h2>
+
+ <ul>
+ <% @team.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/teams/edit.html.erb b/app/views/teams/edit.html.erb
new file mode 100644
index 0000000..49858ad
--- /dev/null
+++ b/app/views/teams/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing team</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @team %> |
+<%= link_to 'Back', teams_path %>
diff --git a/app/views/teams/index.html.erb b/app/views/teams/index.html.erb
new file mode 100644
index 0000000..b077e10
--- /dev/null
+++ b/app/views/teams/index.html.erb
@@ -0,0 +1,25 @@
+<h1>Listing teams</h1>
+
+<table>
+ <thead>
+ <tr>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <% @teams.each do |team| %>
+ <tr>
+ <td><%= link_to 'Show', team %></td>
+ <td><%= link_to 'Edit', edit_team_path(team) %></td>
+ <td><%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %></td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
+
+<br>
+
+<%= link_to 'New Team', new_team_path %>
diff --git a/app/views/teams/index.json.jbuilder b/app/views/teams/index.json.jbuilder
new file mode 100644
index 0000000..b29428b
--- /dev/null
+++ b/app/views/teams/index.json.jbuilder
@@ -0,0 +1,4 @@
+json.array!(@teams) do |team|
+ json.extract! team, :id
+ json.url team_url(team, format: :json)
+end
diff --git a/app/views/teams/new.html.erb b/app/views/teams/new.html.erb
new file mode 100644
index 0000000..433d944
--- /dev/null
+++ b/app/views/teams/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New team</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', teams_path %>
diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb
new file mode 100644
index 0000000..5b18d33
--- /dev/null
+++ b/app/views/teams/show.html.erb
@@ -0,0 +1,4 @@
+<p id="notice"><%= notice %></p>
+
+<%= link_to 'Edit', edit_team_path(@team) %> |
+<%= link_to 'Back', teams_path %>
diff --git a/app/views/teams/show.json.jbuilder b/app/views/teams/show.json.jbuilder
new file mode 100644
index 0000000..1538019
--- /dev/null
+++ b/app/views/teams/show.json.jbuilder
@@ -0,0 +1 @@
+json.extract! @team, :id, :created_at, :updated_at