我正在尝试将我的页面缓存在views文件夹中。我从rack :: Offline页面得到了这个,但我无法弄清楚我在哪里添加代码。
offline = Rack::Offline.configure do
cache "contacts/list." # contacts is the folder in views folder where my list.html.erb file is located
public_path = Rails.public_path
Dir[public_path.join("javascripts/*.js")].each do |file|
cache file.relative_path_from(public_path)
end
end
提前致谢。