0
我使用ERB一个Rails应用程序内渲染ERB模板,像...让ERB.run安静
T = ERB.new(...)
result = T.run(....)
但是我在终端再培训局倾销改造注意到(从ERB模板填充文本)到终端。我怎样才能让ERB安静?
我使用ERB一个Rails应用程序内渲染ERB模板,像...让ERB.run安静
T = ERB.new(...)
result = T.run(....)
但是我在终端再培训局倾销改造注意到(从ERB模板填充文本)到终端。我怎样才能让ERB安静?
我能与此做:
T = ERB.new(...)
file = open('some-new-file.html','w')
file.write T.result(binding) # where binding is the thing that has the data
你为什么渲染模板这种方式? – jonnii 2011-03-03 17:59:58
我正在生成HTML文件。 – codecraig 2011-03-03 18:13:38