Forum: Ruby on Rails expire_fragment problem

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.
6828ffc79486cd2442714bf32286a910?d=identicon&s=25 Vivek Krishna (Guest)
on 2006-01-16 13:08
(Received via mailing list)
Hello,
  I am trying to invalidate a cached fragment.
My fragment looks like

 <% cache (
:controller=>'users',:action=>'additem_to_cart',:action_suffix=>@user.id)
%>

At this point,rails has created 2 cache files correctly and everything
works
fine becuase I dont see rails making calls to the SQL db to get items
from
DB.Instead it uses cache.
Now in

def add_item_to_cart
expire_fragment (
:controller=>'users',:action=>'additem_to_cart',:action_suffix=>@user.id)
end

When I call expire_fragment,Rails creates a new directory 'users' and a
new
cache inside that directory but when rendering the view it still uses
the
old cache fragment.
Isnt expire_fragment supposed to delete the cache files? and why is a
new
directory being created.?
Any clues?
Vivek
This topic is locked and can not be replied to.