Skip to content

Instantly share code, notes, and snippets.

@timriley
Created February 8, 2009 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timriley/60315 to your computer and use it in GitHub Desktop.
Save timriley/60315 to your computer and use it in GitHub Desktop.
helpers do
def versioned_stylesheet(stylesheet)
"/stylesheets/#{stylesheet}.css?" + File.mtime(File.join(Sinatra::Application.views, "stylesheets", "#{stylesheet}.sass")).to_i.to_s
end
def versioned_js(js)
"/javascripts/#{js}.js?" + File.mtime(File.join(Sinatra::Application.public, "javascripts", "#{js}.js")).to_i.to_s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment