Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

add cache_if and cache_unless on caching doc

  • Loading branch information...
commit 861ec91e8c681302cec76d9bce278da829e85df1 1 parent 48ac592
@acapilleri acapilleri authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 guides/source/
9 guides/source/
@@ -104,6 +104,15 @@ This method generates a cache key that depends on all products and can be used i
All available products:
<% end %>
+If you want to cache a fragment under certain condition you can use `cache_if` or `cache_unless`
+<% cache_if (condition, cache_key_for_products) do %>
+ All available products:
+<% end %>
You can also use an Active Record model as the cache key:

0 comments on commit 861ec91

Please sign in to comment.
Something went wrong with that request. Please try again.