0
我试图实现http://blog.sosedoff.com/2011/04/09/serving-maintenance-page-with-rack-middleware/只有一个区别 - 我的消息是读像这样的整体* .html文件:输出到Web浏览器
def default_prompt(t)
File.open("public/tmp/maintenance/maintenance.html", "r").read
end
和输出
if File.exists?(@file)
body = @block.nil? ? default_prompt(time_info) : @block.call(time_info)
res = Response.new
res.write(body)
res.finish
else
@app.call(env)
但是我最终得到了html文件的文本,因为输出被<pre>
标签包围。
我该如何解决这个问题?