ahmet
ahmet

Reputation: 5005

Error message getting printed twice?

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

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

Why is this getting printed out twice?

enter image description here

applicaiton.html.erb

<%= render 'layouts/errors'%>

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 %>

Upvotes: 0

Views: 364

Answers (1)

andrewpthorp
andrewpthorp

Reputation: 5096

I'm not sure I understand what you are saying. It looks like it is correct to me, you have a <div> with a <strong> in it, and a <p> with the same message in it.

If you want the second one to not be printed, remove it.

Upvotes: 1

Related Questions