For some reason I can not expire a cached page. I have created a
sweeper file and I know that the proper methods are being called. I
have also tried just moving the expire_page call into the controller
code, but it still doesn''t work.
The main page is cached with the following to create an index.html file
in the public dir:
class PublicController < ...
caches_page :index
def index
@blog_posts = Blog.find(:all, :limit => 10)
end
...
end
The following is what I have in the Admin::BlogPostController class
class Admin::BlogPostController < ...
cache_sweeper :blog_post_sweeper, :only => [:create, :update,
:destroy]
...
end
And here is the sweeper:
class BlogPostSweeper < ...
observe BlogPost
def after_save
expire_cache :controller => "public", :action =>
"index"
end
end
As I mentioned earlier, I know that it is calling the sweeper method,
but fails to delete the cached file.
Any ideas?
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---