fstephany
fstephany

Reputation: 2354

How to expire a caches_action with a cache_path?

I'm caching an index action with the following:

caches_action :index, :cache_path => Proc.new { |c| c.params }

expire_action :action => :index

The expire_action seems to only expire the index action without any parameters. How can I expire all the caches_action related to index ?

(it is a Rails 2.3.5 application)

Upvotes: 5

Views: 2671

Answers (1)

Tom Lianza
Tom Lianza

Reputation: 4072

If you're not using memcached, you can use expire_fragment with a regexp:

expire_fragment(Regexp.new("/yourpath/youraction\\."))

Upvotes: 3

Related Questions