Solution for: #117: expire cached fragments from the console
ApplicationController.new
- kueda on July 02, 2011, 09:09 PM UTC
ApplicationController.new.expire_fragment("your_cache_key")
or
Rails.cache.delete("your_cache_key")
Keep in mind, though, that your controller instance won't have url_for at its disposal, so you will probably have to construct your cache key manually if you usually use a hash to initialize it. Check out the source for fragment_cache_key, or just use the pattern
views/www.yoursite.com/whatever/url_for/would?generate=true