Rails vite fait : cache et nom de page contenant un point
By jul on Thursday, January 18 2007, 18:52 - Permalink
Les noms de page contenant un point (par exemple dans une action tag/:name pour un tag "Web-2.0") ne sont pas correctement mises en cache avec cache_pages. Voici un petit hack vite fait pour régler le problème :
caches_page :tag
after_filter {|c|
path="public"+c.request.env["PATH_INFO"]
if File.exists?(path) and !File.directory?(path)
File.rename(path,path+".html")
end
}
Comments
This post's comments feed