Browse files

embed code example using backticks in caching guide

  • Loading branch information...
1 parent 7521698 commit ceb1fd34a8b1c6d415bf517e7752c059a3ab386d @lest lest committed Nov 20, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 guides/source/
@@ -465,14 +465,14 @@ end
Instead of a options hash, you can also simply pass in a model, Rails will use the `updated_at` and `cache_key` methods for setting `last_modified` and `etag`:
class ProductsController < ApplicationController
def show
@product = Product.find(params[:id])
respond_with(@product) if stale?(@product)
If you don't have any special response processing and are using the default rendering mechanism (i.e. you're not using respond_to or calling render yourself) then you’ve got an easy helper in fresh_when:

0 comments on commit ceb1fd3

Please sign in to comment.