Permalink
Browse files

moddify error message

  • Loading branch information...
1 parent 137ab8f commit b4569c1538876d87fa318cbdbcdb874863c6e9f0 @blackgemph committed May 8, 2012
@@ -140,3 +140,16 @@ aside {
float: left;
margin-right: 10px;
}
+
+#error_explanation {
+ color:#f00;
+ ul {
+ list-style: none;
+ margin: 0 0 18px 0;
+ }
+}
+
+.field_with_errors {
+ @extend .control-group;
+ @extend .error;
+ }
@@ -1,15 +1,5 @@
<%= form_for(@post) do |f| %>
- <% if @post.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
-
- <ul>
- <% @post.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
+ <%= render 'shared/error_messages' %>
<div class="field">
<%= f.label :content %><br />
@@ -0,0 +1,12 @@
+<% 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 %>
@@ -1,15 +1,5 @@
<%= form_for(@user) do |f| %>
- <% if @user.errors.any? %>
- <div id="error_explanation">
- <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
-
- <ul>
- <% @user.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
+ <%= render 'shared/error_messages' %>
<div class="field">
<%= f.label :name %><br />

0 comments on commit b4569c1

Please sign in to comment.