Topic: expire_fragment (application.rhtml?)

Hi, I have these sidebars that display on every page through the application layout.

application.rhtml:

      <ul>
      <% cache(sidebar_cache_key('tasks')) do %>
        <% open_tasks.each do |t| %>
        <li><%= link_to t.title, :controller => 'project',
        :action => 'show', :id => t.project.id %></li>
        <% end %>
      <% end %>
      </ul>

Here's the sidebar_sweeper.rb:
  def after_save(task)
          expire_cache_for(task)
  end
 
  def after_destroy(task)
          expire_cache_for(task)
  end
         
  private
  def expire_cache_for(record)
    expire_fragment(???) #insert whimper here
  end
end

Problem is I only know how to expire_fragment(:controller => 'foo', :action => 'bar')

Does anyone know how to do this for a layout?

Last edited by CrookedRain (2007-07-27 15:28:01)