提交 05e90755 编写于 作者: R Rafael Mendonça França

Improve the documentation of cache_if and cache_unless

上级 414b1c3d
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册