Go to Google Groups Home    StaticMatic
Asset timestamp

George Drummond <georgedrumm...@gmail.com>

In my project I wanted to cache stylesheets and javascript files on
the client, but also make clients have the latest version of the
assets.

I made a helper method to do this:

Module AssetsHelper
  def stylesheet_link_tag(name)
    href = "#{current_page_relative_path}stylesheets/#{name}.css?#
{Time.now.to_i}"
    tag(:link, {:href => href, :rel => 'stylesheet', :type => 'text/
css'})
  end
end