Hi,
Active Record actions which might Create update Delete the model are:
:create, :delete, :destroy, :update, :update_column
Please make sure that expire_page is really not called, at least in my
environment expire_page is failing to delete the index action of an
controller.
Please try: expire_page('products/index.html')
You ve posted:
cache_sweeper :list__, :only => [ :new, :destroy, :update ]
That should be:
cache_sweeper :product_sweeper, :only =>
[ :create, :delete, :destroy, :update, :update_column ]
--
Volker
On 28 Apr., 11:40, MrUbi <[email protected]> wrote:
> Hi Volker,
>
> the smallest example is: say I have a Products model, a products
> controller with a "index" and a "show" action. In my controller I
> cache the index page using "caches_page :index".
> In my admin namespace, file "app/controllers/admin/
> products_controller.rb", I am using ActiveScaffold
> (active_scaffold :product). Here I want to use
> "cache_sweeper :product_sweeper" where home sweeper calls
> expire_page(:controller => '/products', :action => 'index') method for
> every CRUD action.
> But the sweeper gets never called and the cache never refreshed,
> because I have no actions to bind the call to home_sweeper to. I would
> like it to be triggered after every CRUD action on the products. With
> normal rails scaffolding I would use
>
> cache_sweeper :list__, :only => [ :new, :destroy, :update ]
>
> Is there a way to get this behaviour?
>
> Thank you
> Alessandro
>
> On Apr 28, 8:33 am, "[email protected]"
>
>
>
> <[email protected]> wrote:
> > Hi,
>
> > Can you please explain a little bit what you would exactly like to
> > cache?
>
> > --
> > volker
>
> > On 27 Apr., 01:19, MrUbi <[email protected]> wrote:
>
> > > Hello,
>
> > > this may seem trivial, but it's getting a nightmare since my cache is
> > > never been refreshed :)
> > > I am using activescaffold in the admin area (namespace). There are no
> > > default actions in the admin/xxxxx_controller, and my
>
> > > cache_sweeper :xxxxx_sweeper
>
> > > is never called. I can't find info about it, and don't know how to
> > > refresh the cache with a sweeper after CRUD operation made by
> > > activescaffold.
> > > Thanks
> > > Alessandro
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "ActiveScaffold : Ruby on Rails plugin" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > For more options, visit this group
> > > athttp://groups.google.com/group/activescaffold?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ActiveScaffold : Ruby on Rails plugin" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group
> > athttp://groups.google.com/group/activescaffold?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "ActiveScaffold : Ruby on Rails plugin" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group
> athttp://groups.google.com/group/activescaffold?hl=en.
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.