Skip to content

Instantly share code, notes, and snippets.

@Evanto
Created April 13, 2017 08:17
Show Gist options
  • Save Evanto/2c82113d21e84f0864a19880dc1e1729 to your computer and use it in GitHub Desktop.
Save Evanto/2c82113d21e84f0864a19880dc1e1729 to your computer and use it in GitHub Desktop.
<%= form_for(comment) do |f| %>
<% if comment.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
<ul>
<% comment.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment