Finished iteration D.3 in chapter 9
[depot.git] / app / views / store / index.html.erb
index c65b69b114087113b282c84c086517e72c043c61..fff01dffcb953c92a0c8ebd97a8042ef28c58ebb 100644 (file)
@@ -7,7 +7,9 @@
     <%= product.description %>
     <div class="price-line">
       <span class="price"><%= number_to_currency product.price, :unit => "£" %></span>
-      <%= 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 %>
     </div>
   </div>
 <% end %>