1
0
Fork 0
forked from OpenNeo/impress

better cache items#show

This commit is contained in:
Emi Matchu 2012-08-10 00:02:11 -04:00
parent 99669b8e4e
commit 412c401c5f
2 changed files with 34 additions and 29 deletions

View file

@ -22,6 +22,8 @@ class ItemObserver < ActionController::Caching::Sweeper
def expire_cache_for(item)
controller.expire_fragment("items/#{item.id}#item_link_partial")
controller.expire_fragment("items/#{item.id} header")
controller.expire_fragment("items/#{item.id} info")
end
def expire_newest_items

View file

@ -1,7 +1,8 @@
- title @item.name
- canonical_path @item
%header#item-header
- cache "items/#{@item.id} header" do
%header#item-header
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
%div
%h2#item-name= @item.name
@ -43,9 +44,11 @@
= label_tag "quantity[#{owned}]" do
How many?
= submit_tag 'Save to Your Items'
%p= @item.description
#item-zones
- cache "items/#{@item.id} info" do
%p= @item.description
#item-zones
%p
%strong Occupies:
= list_zones @item.occupied_zones, :uncertain_label
@ -86,8 +89,8 @@
%span.more more
%span.less less
#item-preview-header
- cache 'items#show preview_header' do
#item-preview-header
%h3 Preview
%a#customize-more.button{:href => '/'} Customize more