cache just content on items, not action, so we can still use title and canonical

This commit is contained in:
Emi Matchu 2011-05-20 20:23:37 -04:00
parent 183430adb6
commit 3b7f158890
3 changed files with 40 additions and 38 deletions

View file

@ -1,6 +1,5 @@
class ItemsController < ApplicationController
before_filter :set_query
caches_action :show, :layout => false
def index
if params.has_key?(:q)
@ -61,3 +60,4 @@ class ItemsController < ApplicationController
@query = params[:q]
end
end

View file

@ -2,7 +2,8 @@
- content_for :meta do
%link{:rel => 'canonical', :href => url_for(@item)}
%header
- cache "items_show_#{@item.id}_main_content" do
%header
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
%div
%h2#item-name= @item.name
@ -11,9 +12,9 @@
== Rarity: #{@item.rarity_index} (#{@item.rarity})
%a.button{:href => neoitems_url_for(@item)} NeoItems
%p= @item.description
%p= @item.description
#item-zones
#item-zones
%p
%strong Occupies:
= list_zones @item.occupied_zones, :uncertain_label
@ -24,20 +25,20 @@
- else
= list_zones @item.restricted_zones
#item-preview-header
#item-preview-header
%h3 Preview
%a#customize-more.button{:href => '/'} Customize more
#item-preview
#item-preview
#item-preview-species= standard_species_images_for(@item)
#item-preview-error
#item-preview-swf
Javascript and Flash are required to preview wearables. Sorry!
:javascript
:javascript
var CURRENT_ITEM_ZONES_RESTRICT = #{@item.zones_restrict.inspect},
IMPRESS_HOST = #{RemoteImpressHost.inspect};
= include_javascript_libraries :jquery, :swfobject
= javascript_include_tag 'items/show'
= include_javascript_libraries :jquery, :swfobject
= javascript_include_tag 'items/show'

View file

@ -9,3 +9,4 @@
= submit_tag 'Search', :name => nil
= yield
= render :file => 'layouts/application'