Finished iteration D.3 in chapter 9
[depot.git] / app / views / store / index.html.erb
index c9f41e402827a1e0d2231017607b9aaad7526fca..fff01dffcb953c92a0c8ebd97a8042ef28c58ebb 100644 (file)
@@ -6,8 +6,10 @@
     <h3><%= link_to h(product.title), {:action => "add_to_cart", :id => product}, :method => "post" %></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 %>