Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<%= form_for @account do |f| %>
<%= render "shared/form_errors", :object => @account %>
# ... Other form view code here ...</span>
<% if object.errors.any? %>
<div id="error_explanation">
<h2>Please fix the following <%= pluralize(object.errors.count, "error") %>:</h2>
<ul>
<% object.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<% if @model.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@session.errors.count, "error") %> with form:</h2>
<ul>
<% @session.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
You can’t perform that action at this time.