projects
/
depot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
End chapter 7, with suggested extensions
[depot.git]
/
app
/
views
/
store
/
index.html.erb
diff --git
a/app/views/store/index.html.erb
b/app/views/store/index.html.erb
index 1ed17dd5e287aec1af5b7c85ad68c70656c0f43a..c9f41e402827a1e0d2231017607b9aaad7526fca 100644
(file)
--- a/
app/views/store/index.html.erb
+++ b/
app/views/store/index.html.erb
@@
-2,12
+2,12
@@
<% for product in @products -%>
<div class="entry">
<% for product in @products -%>
<div class="entry">
- <%=
image_tag(product.image_url)
%>
- <h3><%=
h product.title
%></h3>
+ <%=
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>
<%= product.description %>
<div class="price-line">
<span class="price"><%= number_to_currency product.price, :unit => "£" %></span>
<%= product.description %>
<div class="price-line">
<span class="price"><%= number_to_currency product.price, :unit => "£" %></span>
- <%= button_to "Add to cart" %>
+ <%= button_to "Add to cart"
, :action => "add_to_cart", :id => product
%>
</div>
</div>
<% end %>
</div>
</div>
<% end %>