想象一下我在轨道上@template
这是一个实例ActionTemplate::View
.
问题是:我该如何转换@template
谁的@template.source是<%= "hello from erb" %>
to hello from erb
??谢谢
尝试这个...
ERB.new(@template.source).result
ERB#new http://ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/ERB.html#method-c-new
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)