<% if model.errors.any? %>
    <div id="error_explanation" class="alert alert-danger">
      <h4><%= pluralize(model.errors.count, 'error') %> prohibited this <%= model.class.model_name.human %> from being saved:</h4>

      <ul>
        <% model.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
<% end %>