错误信息被打印两次?

时间:2011-12-06 14:39:43

标签: ruby-on-rails ruby-on-rails-3

<div class="alert-message notice fade in">
<strong>Product was successfully updated.</strong>
</div>

<p id="notice">Product was successfully updated.</p>

为什么要打印两次?

enter image description here

application.html.erb

<%= render 'layouts/errors'%>

布局/错误

<% flash.each do |key, value| %>
   <div class="alert-message <%= key %> fade in">
    <a class="close" href="#">&times</a>
    <center><strong><%= value %></strong></center>
  </div>
<% end %>

1 个答案:

答案 0 :(得分:1)

我不确定我明白你在说什么。它看起来对我来说是正确的,你的<div>中有<strong>,而<p>中有相同的信息。

如果您想要不打印第二张,请将其删除。