How to call expire_fragment in rails console


Today i want expire a fragment cache in my view.

<% cache('zires') do %>
<% end %>

So, i enter rails console – Rails c production, but i found Rails.cache.exist?('zires') return false.


Because your cache key is wrong! Check fragment_cache_key(key), rails adds a dynamic namespace – :views binding on key.

The easiest way:'zires', options = nil)

Leave a Reply

Your email address will not be published. Required fields are marked *