forked from JumpstartLab/son_of_store_engine
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper caching for products and orders. Render in 10ms or less.
Begin CSS on product index and order show.
- Loading branch information
Mary Cutrali
committed
May 2, 2012
1 parent
aa0aacc
commit 8e1cf88
Showing
3 changed files
with
34 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
- cache(@order) do | ||
h2#order_number = "Order ##{@order.id}" | ||
h3 = "Status: #{@order.status}" | ||
h3 = "Total: #{@order.total}" | ||
h4 | ||
= "To visit this order again in the future use your " | ||
= link_to "order permalink", permalink(@order), :id => 'unique_url' | ||
h2#order_number = "Order ##{@order.id}" | ||
h3 = "Status: #{@order.status}" | ||
h3 = "Total: #{@order.total}" | ||
h4 | ||
= "To visit this order again in the future use your " | ||
= link_to "order permalink", permalink(@order), :id => 'unique_url' | ||
|
||
table.table.table-striped.table-condensed | ||
tr | ||
th Name | ||
th Price | ||
th Quantity | ||
th Subtotal | ||
- @order.items.each do |item| | ||
- cache(item) do | ||
tr | ||
td = link_to(item.title, product_path(@store, item.product)) | ||
td = link_to(item.price, product_path(@store, item.product)) | ||
td = link_to(item.quantity, product_path(@store, item.product)) | ||
td = link_to(item.subtotal, product_path(@store, item.product)) | ||
table.table.table-striped.table-condensed | ||
tr | ||
th Name | ||
th Price | ||
th Quantity | ||
th Subtotal | ||
- @order.items.each do |item| | ||
tr | ||
td = link_to(item.title, product_path(@store, item.product)) | ||
td = link_to(item.price, product_path(@store, item.product)) | ||
td = link_to(item.quantity, product_path(@store, item.product)) | ||
td = link_to(item.subtotal, product_path(@store, item.product)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
h1 Products | ||
.products-listing | ||
- @products.each do |product| | ||
.indiv-product | ||
.product-thumbnail | ||
img src="#{product.photo}" | ||
.product-details | ||
#prod-index-title | ||
= link_to product.title, product_path(@store, product) | ||
#prod-index-price | ||
= number_to_currency(product.price) | ||
#prod-index-cart | ||
= link_to "Add to Cart", cart_path(:product_id => product), :method => :put, :class=>'btn btn-mini' | ||
.indiv-product | ||
.product-thumbnail | ||
img src="#{product.photo}" | ||
.product-details | ||
#prod-index-title | ||
= link_to product.title, product_path(@store, product) | ||
#prod-index-price | ||
= number_to_currency(product.price) | ||
#prod-index-cart | ||
= link_to "Add to Cart", cart_path(:product_id => product), :method => :put, :class=>'btn btn-mini' | ||
= will_paginate @productsg |