0
我還是新來haml,想知道如何轉換這行代碼才能正常工作。我正在使用設計來獲取註冊頁面。如何將這一行的erb轉換爲haml?
<em>(<%= @minimum_password_length %> characters minimum)</em>
當我離開erb中的代碼時,頁面工作正常,但嘗試將其轉換爲haml後,我在此行發生錯誤。我試過下面的代碼
%em
= @minimum_password_length + (characters minimum)
但我得到一個錯誤說
undefined local variable or method `minimum'
當我嘗試沒有括號我得到一個錯誤說提前
syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
謝謝!
http://html2haml.herokuapp.com/ –