Created
October 20, 2013 01:35
-
-
Save chadjemmett/7063810 to your computer and use it in GitHub Desktop.
Shared error messages for ruby on rails.
Replace @user with relevant variable.
Also change the css classes and such to match the app you use it on.
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
<% if @user.errors.any? %> | |
<div id="error_explanation" > | |
<div class="alert alert-error"> | |
The form contains <%= pluralize(@user.errors.count, "error") %>. | |
</div> | |
<ul> | |
<% @user.errors.full_messages.each do |msg| %> | |
<li>* <%= msg %></li></br> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment