Created
December 25, 2013 02:01
-
-
Save nodunayo/8119582 to your computer and use it in GitHub Desktop.
Rails error message notifications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#place immediately under 'form_for' line | |
<% if @item.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@item.errors.count, "error") %> prohibited this item from being saved:</h2> | |
<ul> | |
<% @item.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