Created
June 25, 2012 16:23
-
-
Save smonteverdi/2989563 to your computer and use it in GitHub Desktop.
Rails: Partial: Display Form Errors
This file contains 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 object.errors.any? %> | |
<div id="error_explanation"> | |
<h2>Oops, looks like <%= pluralize(object.errors.count, "error") %> | |
occured:</h2> | |
<br /> | |
<ul> | |
<% object.errors.each do |key, msg| %> | |
<li><%=key%> <%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<%= render :partial => 'name_of_partial_to_show_model_errors', :locals => {:object => @model1} %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment