X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=app%2Fviews%2Fstore%2Findex.html.erb;h=f3e7ebedff34db7d48abeaa01929ff076ef094ae;hb=f9d45398338f9e5b2dabd768fcd793c4f81934f2;hp=c9f41e402827a1e0d2231017607b9aaad7526fca;hpb=f64339ce335029afcf8ba9cbe7fc38da42443684;p=depot.git

diff --git a/app/views/store/index.html.erb b/app/views/store/index.html.erb
index c9f41e4..f3e7ebe 100644
--- a/app/views/store/index.html.erb
+++ b/app/views/store/index.html.erb
@@ -2,12 +2,16 @@
 
 <% for product in @products -%>
   <div class="entry">
-    <%= link_to image_tag(product.image_url), {:action => "add_to_cart", :id => product}, :method => "post" %>
-    <h3><%= link_to h(product.title), {:action => "add_to_cart", :id => product}, :method => "post" %></h3>
+    <% form_remote_tag :url => {:action => 'add_to_cart', :id => product} do %>
+      <%= image_submit_tag(product.image_url) %>
+    <% end %>
+    <h3><%= h(product.title) %></h3>
     <%= product.description %>
     <div class="price-line">
-      <span class="price"><%= number_to_currency product.price, :unit => "&pound;" %></span>
-      <%= button_to "Add to cart", :action => "add_to_cart", :id => product %>
+      <span class="price"><%= number_to_currency product.price, :unit => "£" %></span>
+      <% form_remote_tag :url => {:action => 'add_to_cart', :id => product} do %>
+        <%= submit_tag "Add to cart" %>
+      <% end %>
     </div>
   </div>
 <% end %>