about summary refs log tree commit diff
path: root/app/views/machines
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2021-09-27 01:33:06 -0400
committerBen Harris <ben@tilde.team>2021-09-27 01:33:06 -0400
commit848c59f15e83c0571be956726284d8d9180679b4 (patch)
tree4044505bcf5e89c75e10f94de3690b18c164cc89 /app/views/machines
parentf9ea5e999a298f658ef7fb2abc7c13ba3ca412cb (diff)
add delete button to list views
Diffstat (limited to 'app/views/machines')
-rw-r--r--app/views/machines/index.html.erb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/views/machines/index.html.erb b/app/views/machines/index.html.erb
index 5abd2c2..f099ea6 100644
--- a/app/views/machines/index.html.erb
+++ b/app/views/machines/index.html.erb
@@ -1,16 +1,19 @@
 <h1>Pinball Machines</h1>
 
-
 <table>
   <thead>
     <th>Name</th>
     <th>Edition</th>
+    <th>Delete</th>
   </thead>
   <tbody>
     <% @machines.each do |machine| %>
       <tr>
         <td><%= link_to machine.name, edit_machine_path(machine) %></td>
         <td><%= machine.edition %></td>
+        <td><%= link_to "X", machine_path(machine),
+          method: :delete,
+          data: { confirm: "Are you sure?" } %></td>
       </tr>
     <% end %>
   </tbody>
@@ -19,4 +22,3 @@
 <hr>
 <p><%= @machines.size %> available machines</p>
 <%= link_to "+ Add Machine", new_machine_path %>
-