3
當我跑這條線:ERB不承認 - %>標籤
ERB.new("<%= 'hi' %>").result
它工作正常,我得到這個輸出:"hi"
但是當我運行這條線:
ERB.new("<%= 'hi' -%>").result
我得到這個錯誤:
SyntaxError: compile error
(erb):1: syntax error, unexpected ')'
_erbout = ''; _erbout.concat(('hi' -).to_s); _erbout
我該如何解決這個問題?
謝謝,但這種保護的功能「 - %>'標籤? –
是的,請參閱'ERB.new(「<%= 'hi' -%> \ nblah」,nil,' - ')。result' vs.'ERB.new(「<%= 'hi' %> \ nblah」,nil,' - ')。results' – Petr
Awesome thanks man ! –