diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-14 15:17:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-14 15:17:23 -0300 |
commit | 05e9075541f435b579a96a2519ab71ec27ace895 (patch) | |
tree | 918780c779c87c4a4747ee4d32ed108ce8a9d1cc | |
parent | 414b1c3da69891537e50ca2d5e5efa05a7f8eed0 (diff) | |
download | rails-05e9075541f435b579a96a2519ab71ec27ace895.tar.gz rails-05e9075541f435b579a96a2519ab71ec27ace895.tar.bz2 rails-05e9075541f435b579a96a2519ab71ec27ace895.zip |
Improve the documentation of cache_if and cache_unless
-rw-r--r-- | actionpack/lib/action_view/helpers/cache_helper.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index 932a5fa65a..995aa10afb 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -120,9 +120,8 @@ module ActionView nil end - #Chache fragments of a view if +condition+ is true + # Cache fragments of a view if +condition+ is true # - #=== Example # <%= cache_if admin?, project do %> # <b>All the topics on this project</b> # <%= render project.topics %> @@ -137,8 +136,12 @@ module ActionView nil end - #Chache fragments of a view unless +condition+ is true - #(see +cache_if+ for a example) + # Cache fragments of a view unless +condition+ is true + # + # <%= cache_unless admin?, project do %> + # <b>All the topics on this project</b> + # <%= render project.topics %> + # <% end %> def cache_unless(condition, name = {}, options = nil, &block) cache_if !condition, name, options, &block end |