X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;ds=sidebyside;f=app%2Fviews%2Fstore%2Findex.html.erb;h=7bbc2abaad5eab95d8f72a1d949edc92443cb10e;hb=05c481a0756c1fa0a9956b21a912de2c10914ef2;hp=c65b69b114087113b282c84c086517e72c043c61;hpb=94adcb93b1eac6b07408de9db7f12d46e9e7d390;p=depot.git
diff --git a/app/views/store/index.html.erb b/app/views/store/index.html.erb
index c65b69b..7bbc2ab 100644
--- a/app/views/store/index.html.erb
+++ b/app/views/store/index.html.erb
@@ -2,12 +2,17 @@
<% for product in @products -%>
- <%= 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" %>
+ <% form_remote_tag :url => {:action => 'add_to_cart', :id => product} do %>
+ <%= image_submit_tag(product.image_url) %>
+ <% end %>
+
<%= h(product.title) %>
<%= product.description %>
<%= number_to_currency product.price, :unit => "£" %>
- <%= button_to "Add to cart", :action => "add_to_cart", :id => product %>
+ <% form_remote_tag :url => {:action => 'add_to_cart', :id => product} do %>
+ <%= submit_tag "Add to cart" %>
+ <% end %>
<% end %>
+