method

cache_if

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActionView::Helpers::CacheHelper
cache_if(condition, name = {}, options = {}, &block) public

Cache fragments of a view if condition is true

<% cache_if admin?, project do %>
  <b>All the topics on this project</b>
  <%= render project.topics %>
<% end %>
Show source
Register or log in to add new notes.