forked from OpenNeo/impress
better cache items#show
This commit is contained in:
parent
99669b8e4e
commit
412c401c5f
2 changed files with 34 additions and 29 deletions
|
@ -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
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
- title @item.name
|
||||
- canonical_path @item
|
||||
|
||||
- cache "items/#{@item.id} header" do
|
||||
%header#item-header
|
||||
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
|
||||
%div
|
||||
|
@ -43,6 +44,8 @@
|
|||
= label_tag "quantity[#{owned}]" do
|
||||
How many?
|
||||
= submit_tag 'Save to Your Items'
|
||||
|
||||
- cache "items/#{@item.id} info" do
|
||||
%p= @item.description
|
||||
|
||||
#item-zones
|
||||
|
@ -86,7 +89,7 @@
|
|||
%span.more more
|
||||
%span.less less
|
||||
|
||||
|
||||
- cache 'items#show preview_header' do
|
||||
#item-preview-header
|
||||
%h3 Preview
|
||||
%a#customize-more.button{:href => '/'} Customize more
|
||||
|
|
Loading…
Reference in a new issue