Skip to content
Browse files

Improve the documentation of cache_if and cache_unless

  • Loading branch information...
1 parent 414b1c3 commit 05e9075541f435b579a96a2519ab71ec27ace895 @rafaelfranca rafaelfranca committed Dec 14, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 actionpack/lib/action_view/helpers/cache_helper.rb
View
11 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 %>
# <b>All the topics on this project</b>
# <%= 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 %>
+ # <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

0 comments on commit 05e9075

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