Created tables, product scaffold
[depot.git] / app / views / products / index.html.erb
diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb
new file mode 100644 (file)
index 0000000..88120ee
--- /dev/null
@@ -0,0 +1,24 @@
+<h1>Listing products</h1>
+
+<table>
+  <tr>
+    <th>Title</th>
+    <th>Description</th>
+    <th>Image url</th>
+  </tr>
+
+<% for product in @products %>
+  <tr>
+    <td><%=h product.title %></td>
+    <td><%=h product.description %></td>
+    <td><%=h product.image_url %></td>
+    <td><%= link_to 'Show', product %></td>
+    <td><%= link_to 'Edit', edit_product_path(product) %></td>
+    <td><%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %></td>
+  </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New product', new_product_path %>