app/views/shared/_error_messages.html.erb
<% if target.errors.any? %>
<% if target.errors.any? %>
<div div class="alert alert-danger" role="alert">
<h2><%= pluralize(target.errors.count, "error") %>:</h2>
<ul>
<% target.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<% end %>