Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class PersonSweeper < ActionController::Caching::Sweeper
observe Person
def after_create(person)
expire_cache_for person
end
def after_update(person)
expire_cache_for person
end
def after_destroy(person)
expire_cache_for person
end
private
def expire_cache_for(person)
expire_page :action => :index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.