Skip to content

Instantly share code, notes, and snippets.

@D3MZ
Created December 5, 2012 03:18
Show Gist options
  • Save D3MZ/4211879 to your computer and use it in GitHub Desktop.
Save D3MZ/4211879 to your computer and use it in GitHub Desktop.
More HAML goodness
<% 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>
<% end %>
</ul>
</div>
<% end %>
=if @user.errors.any?
#error_explanation
.alert.alert-error
==the form contains #{pluralize(@user.errors.count, "error")}
%ul
[email protected]_messages.each do |msg|
%li * #{msg}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment