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