Forum: Ruby on Rails clearing/expiring the 'index' action.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B45eab4f18aa1bb2a44d6e657531a642?d=identicon&s=25 Alain Ravet (aravet)
on 2006-01-21 17:02
Hi all,

I'm having problems trying to expire the 'index' action of a controller.

In short,
   expire_action :action => 'index'
doesn't work, but
      expire_fragment (url_for :action =>
'index').gsub(/\/index/,'').split("://").last
works fine and deletes the cached page as expected.


I thought about this hack when I noticed that the cache for 'index' is
not stored in a directory named as the action, but directly at the root
level:
  cache/localhost:3001/foo.cache

I expected it to be stored 1 level deeper, in
  cache/localhost:3001/foo/index.cache

Is there a cleaner way to make this work?
Is this a bug?


Alain
B45eab4f18aa1bb2a44d6e657531a642?d=identicon&s=25 Alain Ravet (aravet)
on 2006-01-21 17:05
Hi all,

I'm having problems trying to expire the 'index' action of a controller.

In short,
   expire_action :action => 'index'
doesn't work, but
      expire_fragment (url_for :action =>
'index').gsub(/\/index/,'').split("://").last
works fine and deletes the cached page as expected.


I thought about this hack when I noticed that the cache for 'index' is
not stored in a directory named as the action, but directly at the root
level:
  cache/localhost:3001/foo.cache

I expected it to be stored 1 level deeper, in
  cache/localhost:3001/foo/index.cache

Is there a cleaner way to make this work?
Is thi
This topic is locked and can not be replied to.