當我有2個視圖片段緩存相同的查詢,但顯示它們不同,只有一個片段,他們都顯示相同的方式。有沒有辦法解決?例如...Memcached和Rails片段緩存問題
#views/posts/list
- cache(@posts) do
- for p in @posts
= p.title
#views/posts/list_with_images
- cache(@posts) do
- for p in @posts
= p.title
= p.content
= image_tag(p.image_url)
#controllers/posts_controller
def list
...
@posts = Post.all
end
def list_with_images
...
@posts = Post.all
end