0
我正在學習本教程(http://ruby.railstutorial.org/chapters/sign-up#sec:signup_form)。然而,當清單代碼在7.23(轉換爲HAML)在HAML上雙重打印實例變量
=if @user.errors.any?
%div{:id => "error_explanation"}
%div{:class=>"alert alert-error"}
il modulo contiene errori
%ul
= @user.errors.full_messages.each do |msg|
%li
= msg
我結束了一個雙重打印:預期的一個,接着是排序變量
Name can't be blank
Password is too long (maximum is 15 characters)
["Name can't be blank", "Password is too long (maximum is 15 characters)"]
<h1>Registrazione nuovo utente</h1> <div id='error_explanation'> <div class='alert alert-error'> il modulo contiene errori <ul> <li> Name can't be blank </li> <li> Password is too long (maximum is 15 characters) </li> ["Name can't be blank", "Password is too long (maximum is 15 characters)"]</ul> </div> </div>
我的打印輸出的對於rails編程來說真的很陌生,但我真的無法得到。
感謝,馬塞羅
謝謝。我應該多加註意! – piffy 2012-04-28 10:42:33