1
0
Fork 0
forked from OpenNeo/impress

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

View file

@ -2,6 +2,7 @@
- content_for :meta do - content_for :meta do
%link{:rel => 'canonical', :href => url_for(@item)} %link{:rel => 'canonical', :href => url_for(@item)}
- cache "items_show_#{@item.id}_main_content" do
%header %header
= image_tag @item.thumbnail_url, :id => 'item-thumbnail' = image_tag @item.thumbnail_url, :id => 'item-thumbnail'
%div %div

View file

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