我有设计的问题:设计效果很好,但在设计/注册/new.html.erb 我有下一个字符串
<%= devise_error_messages! %>
该字符串形成错误消息,例如->
<div id="error_explanation">
<h2>5 errors prohibited this user from being saved:</h2>
<ul>
<li>Email has already been taken</li>
<li>Password can't be blank</li>
<li>Phone is not a number</li>
</ul>
</div>
在我的表单顶部(在我的表单元素上)形成的所有错误的味精如何在发生此错误的元素旁边创建错误消息?
像这样的东西
<div>Email<br />
**<div class='email_error'>....</div>**
<div class="field_with_errors">
<input id="user_email".... />
</div>
</div>
<div>Name<br />
**<div class='name_error'>....</div>**
<div class="field_with_errors">
<input id="user_name".... />
</div>
</div>