From 05e9075541f435b579a96a2519ab71ec27ace895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 14 Dec 2012 15:17:23 -0300 Subject: [PATCH] Improve the documentation of cache_if and cache_unless --- actionpack/lib/action_view/helpers/cache_helper.rb | 11 +++++++---- 1 file 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 @@ def cache(name = {}, options = nil, &block) 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 %> # All the topics on this project # <%= render project.topics %> @@ -137,8 +136,12 @@ def cache_if(condition, name = {}, options = nil, &block) 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 %> + # All the topics on this project + # <%= render project.topics %> + # <% end %> def cache_unless(condition, name = {}, options = nil, &block) cache_if !condition, name, options, &block end -- GitLab