How do I expire a view cached fragment from console?

Ben Crouse picture Ben Crouse · Apr 16, 2009 · Viewed 13.2k times · Source

Something like

Rails.cache.delete('site_search_form')

doesn't seem to work. Is this possible? Thanks.

Answer

gleuch picture gleuch · May 8, 2009

ActionController::Base.new.expire_fragment(key)