Skip to content

Instantly share code, notes, and snippets.

@stammy
Created May 9, 2011 00:43
Show Gist options
  • Save stammy/961862 to your computer and use it in GitHub Desktop.
Save stammy/961862 to your computer and use it in GitHub Desktop.
rails 3 error_messages_for deprecation replacement
<% if @user.errors.any? %>
<div id="errorExplanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this record from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment