about summary refs log tree commit diff
path: root/app/views/machines
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2021-09-14 17:25:37 -0400
committerBen Harris <ben@tilde.team>2021-09-14 17:25:37 -0400
commitd1a328f413f83a33398a3b1682c8a8327184b2b0 (patch)
tree02cbf8a46cd3de3688843f1b1f987e7247fa43da /app/views/machines
parent68f5f71701f53dffba53b3390b8e01cc23cc3d9c (diff)
tidy up lists
Diffstat (limited to 'app/views/machines')
-rw-r--r--app/views/machines/_form.html.erb2
-rw-r--r--app/views/machines/edit.html.erb4
-rw-r--r--app/views/machines/index.html.erb27
3 files changed, 23 insertions, 10 deletions
diff --git a/app/views/machines/_form.html.erb b/app/views/machines/_form.html.erb
index 1f693aa..d7edc05 100644
--- a/app/views/machines/_form.html.erb
+++ b/app/views/machines/_form.html.erb
@@ -1,4 +1,4 @@
-<%= form_with model: @machine do |form| %>
+<%= form_with model: @machine, data: { "turbo" => "false" } do |form| %>
   <br>
   <div>
     <%= form.label :name %><br>
diff --git a/app/views/machines/edit.html.erb b/app/views/machines/edit.html.erb
index 7fd30ce..477a0ee 100644
--- a/app/views/machines/edit.html.erb
+++ b/app/views/machines/edit.html.erb
@@ -2,3 +2,7 @@
 
 <%= render "form", machine: @machine %>
 
+<p><%= link_to "Delete #{@machine.name}", machine_path(@machine),
+    method: :delete,
+    data: { confirm: "Are you sure?" } %></p>
+
diff --git a/app/views/machines/index.html.erb b/app/views/machines/index.html.erb
index 33e279b..5abd2c2 100644
--- a/app/views/machines/index.html.erb
+++ b/app/views/machines/index.html.erb
@@ -1,13 +1,22 @@
 <h1>Pinball Machines</h1>
 
+
+<table>
+  <thead>
+    <th>Name</th>
+    <th>Edition</th>
+  </thead>
+  <tbody>
+    <% @machines.each do |machine| %>
+      <tr>
+        <td><%= link_to machine.name, edit_machine_path(machine) %></td>
+        <td><%= machine.edition %></td>
+      </tr>
+    <% end %>
+  </tbody>
+</table>
+
+<hr>
 <p><%= @machines.size %> available machines</p>
-<ul>
-  <% @machines.each do |machine| %>
-    <li>
-      <%= link_to machine.name, machine %>
-    </li>
-  <% end %>
-</ul>
-
-<%= link_to "Add Machine", new_machine_path %>
+<%= link_to "+ Add Machine", new_machine_path %>