Topic: [SOLVED] sweepers in nested routes
I have a controller called posts where I want to cache index and show pages.
caches_page :index, :show
I have a sweepers directory with the following.
class PostSweeper < ActionController::Caching::Sweeper
expire_page :controller => 'posts', :action => 'index', :format => 'html'
expire_page :controller => 'posts', :action => 'show', :id => post.id :format => 'html'
Now that normally would work just fine for me. Problem is in this app I am trying to call the sweeper from a nested route, /admin/posts/
map.namespace :admin do |admin|
cache_sweeper :post_sweeper, :only => [:create, :update, :destroy]
Never runs the sweeper or its trying to run it for the admin/posts controller where there is no cache. To be completely honest I'm not positive what its doing. What I need to change or how to even debug this. Can someone explain how to set this up for a nested route?
Last edited by gregf (2008-02-05 16:42:59)