Method: ActionView::Helpers::CacheHelper#cache_unless

Defined in:
actionview/lib/action_view/helpers/cache_helper.rb

#cache_unless(condition, name = {}, options = {}, &block) ⇒ Object

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 %>


231
232
233
# 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