Skip to content

Instantly share code, notes, and snippets.

@songjiz
Last active December 28, 2020 03:57
Show Gist options
  • Save songjiz/4606ded34be11b1ee43e5d2031308789 to your computer and use it in GitHub Desktop.
Save songjiz/4606ded34be11b1ee43e5d2031308789 to your computer and use it in GitHub Desktop.
<% if object.errors.any? %>
<div id="error_explanation" class="alert alert-danger alert-dismissible animate__animated animate__pulse" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="alert-heading">
<%= t "activerecord.errors.template.header", count: object.errors.count, model: object.model_name.human %>
</h4>
<div>
<p><%= t "activerecord.errors.template.body" %></p>
<ul>
<% object.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment