X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=app%2Fviews%2Fproducts%2Findex.html.erb;h=6bb547aa96d8023ebc9d510494ba5354c34bb5c2;hb=3b424e341e1dda1f67b4461de089b76eb69bbc70;hp=88120ee7e05a27a417f52f7b280dd760a9ecc1a8;hpb=e580d4626176c8deb6f44fec7e66f980b5923b29;p=depot.git diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index 88120ee..6bb547a 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -1,24 +1,39 @@ -

Listing products

+
+

Listing products

- - - - - - +
TitleDescriptionImage url
+ <% for product in @products %> + -<% for product in @products %> - - - - - - - - -<% end %> -
<%=h product.title %><%=h product.description %><%=h product.image_url %><%= link_to 'Show', product %><%= link_to 'Edit', edit_product_path(product) %><%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %>
+ + <%= image_tag product.image_url, :class => 'list-image' %> + -
+ +
+
<%= h product.title %>
+
<%= h truncate(product.description.gsub(/<.*?>/, ''), + :length => 80) %>
+ <% if product.date_available.past? %> +
Available since <%= product.date_available %>
+ <% else %> +
Available from <%= product.date_available %>
+ <% end %> +
+ + + + <%= link_to 'Show', product %>
+ <%= link_to 'Edit', edit_product_path(product) %>
+ <%= link_to 'Destroy', product, + :confirm => 'Are you sure?', + :method => :delete %> + + + <% end %> + +
+ +
<%= link_to 'New product', new_product_path %>