September 2016
Intermediate to advanced
488 pages
12h 21m
English
Let’s take a look once again at a simple view that we use in the Depot application, in this case, one that presents our storefront:
| | <p id="notice"><%= notice %></p> |
| | |
| | <h1><%= t('.title_html') %></h1> |
| | |
| | <% 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> |
| | <%= button_to t('.add_html'), |
| | line_items_path(product_id: product, locale: I18n.locale), ... |
Read now
Unlock full access