diff --git a/app/views/store/index.html.erb b/app/views/store/index.html.erb index 6e77806..f82b1b5 100644 --- a/app/views/store/index.html.erb +++ b/app/views/store/index.html.erb @@ -2,13 +2,17 @@

Your Pragmatic Catalog

-<% @products.each do |product| %> -
- <%= image_tag(product.image_url) %> -

<%= product.title %>

- <%= sanitize(product.description) %> -
- <%= number_to_currency(product.price) %> -
-
+<% cache @products do %> + <% @products.each do |product| %> + <% cache product do %> +
+ <%= image_tag(product.image_url) %> +

<%= product.title %>

+ <%= sanitize(product.description) %> +
+ <%= number_to_currency(product.price) %> +
+
+ <% end %> + <% end %> <% end %>