method

caching?

rails latest stable - Class: ActionView::Helpers::CacheHelper
caching?()
public

Returns whether the current view fragment is within a cache block.

Useful when certain fragments aren’t cacheable:

<% cache project do %>
  <% raise StandardError, "Caching private data!" if caching? %>
<% end %>