X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=app%2Fviews%2Fstore%2Findex.html.erb;fp=app%2Fviews%2Fstore%2Findex.html.erb;h=c9f41e402827a1e0d2231017607b9aaad7526fca;hb=f64339ce335029afcf8ba9cbe7fc38da42443684;hp=1ed17dd5e287aec1af5b7c85ad68c70656c0f43a;hpb=6af7ab424668bc5dce20630e1b112bc611edab63;p=depot.git diff --git a/app/views/store/index.html.erb b/app/views/store/index.html.erb index 1ed17dd..c9f41e4 100644 --- a/app/views/store/index.html.erb +++ b/app/views/store/index.html.erb @@ -2,12 +2,12 @@ <% for product in @products -%>
- <%= image_tag(product.image_url) %> -

<%=h product.title %>

+ <%= link_to image_tag(product.image_url), {:action => "add_to_cart", :id => product}, :method => "post" %> +

<%= link_to h(product.title), {:action => "add_to_cart", :id => product}, :method => "post" %>

<%= product.description %>
<%= number_to_currency product.price, :unit => "£" %> - <%= button_to "Add to cart" %> + <%= button_to "Add to cart", :action => "add_to_cart", :id => product %>
<% end %>