Skip to content

Instantly share code, notes, and snippets.

@rociiu
Forked from stammy/gist:961862
Created June 1, 2011 06:56
Show Gist options
  • Save rociiu/1001905 to your computer and use it in GitHub Desktop.
Save rociiu/1001905 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