Skip to content

Instantly share code, notes, and snippets.

@steveclarke
Created December 1, 2011 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveclarke/1412518 to your computer and use it in GitHub Desktop.
Save steveclarke/1412518 to your computer and use it in GitHub Desktop.
Error messages for object
<% if @obj.errors.any? %>
<div class="error-messages">
<h2><%= pluralize(@obj.errors.count, 'error') %> are preventing this object from being created:</h2>
<ul>
<% @obj.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
@steveclarke
Copy link
Author

Also style .field_with_errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment