method

uncacheable!

uncacheable!()
public

Raises UncacheableFragmentError when called from within a cache block.

Useful to denote helper methods that can’t participate in fragment caching:

def project_name_with_time(project)
  uncacheable!
  "#{project.name} - #{Time.now}"
end

# Which will then raise if used within a +cache+ block:
<% cache project do %>
  <%= project_name_with_time(project) %>
<% end %>