instance method
cache_unless
Ruby on Rails 7.1.6
Since v4.0.13Signature
cache_unless(condition, name = {}, options = {}, &block)
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 %>
Parameters
-
conditionreq -
nameopt = {} -
optionsopt = {} -
blockblock
Source
# File actionview/lib/action_view/helpers/cache_helper.rb, line 231
def cache_unless(condition, name = {}, options = {}, &block)
cache_if !condition, name, options, &block
end
Defined in actionview/lib/action_view/helpers/cache_helper.rb line 231
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::CacheHelper