diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2012-11-20 16:17:13 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2012-11-20 16:20:13 +0300 |
commit | ceb1fd34a8b1c6d415bf517e7752c059a3ab386d (patch) | |
tree | d353d0f6aea6d09d07f9e6f2d41c929b645703d7 /guides/source | |
parent | 7521698c1741d40da28dbcf95e6cd45a704d337d (diff) | |
download | rails-ceb1fd34a8b1c6d415bf517e7752c059a3ab386d.tar.gz rails-ceb1fd34a8b1c6d415bf517e7752c059a3ab386d.tar.bz2 rails-ceb1fd34a8b1c6d415bf517e7752c059a3ab386d.zip |
embed code example using backticks in caching guide
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/caching_with_rails.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/caching_with_rails.md b/guides/source/caching_with_rails.md index 4cb76bfe5f..826ddd264a 100644 --- a/guides/source/caching_with_rails.md +++ b/guides/source/caching_with_rails.md @@ -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`: -<ruby> +```ruby class ProductsController < ApplicationController def show @product = Product.find(params[:id]) respond_with(@product) if stale?(@product) end end -</ruby> +``` 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: |