Use decent bootstrap errors
This commit is contained in:
parent
b064cb21ef
commit
a646429565
1 changed files with 14 additions and 5 deletions
|
@ -1,5 +1,14 @@
|
|||
<ul>
|
||||
<% model.errors.full_messages.each do |e| %>
|
||||
<%= content_tag(:li, e) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if model.errors.any? %>
|
||||
<div class="panel panel-danger form-errors">
|
||||
<div class="panel-heading">
|
||||
<%= pluralize(model.errors.count, "error") %> prohibited this <%= model.class.name.downcase %> from being saved:
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul>
|
||||
<% model.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in a new issue