瀏覽代碼

Iteration C5.

master
Nils Dittberner 9 年之前
父節點
當前提交
792a8a2a57
共有 1 個文件被更改,包括 13 次插入9 次删除
  1. +13
    -9
      app/views/store/index.html.erb

+ 13
- 9
app/views/store/index.html.erb 查看文件

@@ -2,13 +2,17 @@

<h1>Your Pragmatic Catalog</h1>

<% @products.each do |product| %>
<div class="entry">
<%= image_tag(product.image_url) %>
<h3><%= product.title %></h3>
<%= sanitize(product.description) %>
<div class="price_line">
<span class="price"><%= number_to_currency(product.price) %></span>
</div>
</div>
<% cache @products do %>
<% @products.each do |product| %>
<% cache product do %>
<div class="entry">
<%= image_tag(product.image_url) %>
<h3><%= product.title %></h3>
<%= sanitize(product.description) %>
<div class="price_line">
<span class="price"><%= number_to_currency(product.price) %></span>
</div>
</div>
<% end %>
<% end %>
<% end %>

Loading…
取消
儲存