当我使用erb方法时:
require 'erb'
def erb(template)
path = File.expand_path("../views/#{template}", __FILE__)
ERB.new(File.read(path)).result(binding)
end
然后使用a:
Rack::Response.new(erb('default.html.erb'))
它提出了一个Errno :: ENOENT。为什么是这样?谢谢!
答案 0 :(得分:1)
看起来您的文件路径可能有误。检查以确保正确。