summaryrefslogtreecommitdiff
path: root/app/views/common
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-03-04 17:44:48 -0500
committerguntasgrewal <guntasgrewal@gmail.com>2014-03-04 17:44:48 -0500
commit6b27e11f1613967d2b97b0eead6cf06263e6140b (patch)
tree67665de6ce65f759d4cac18d26f813343c0fe04c /app/views/common
parent489a9f7291b6b7c1143bb482f637020d82f944d5 (diff)
parent8e005f8d325a43e378f21a1042df6a4baf79c12f (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/views/common')
-rw-r--r--app/views/common/_error_messages.html.erb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/views/common/_error_messages.html.erb b/app/views/common/_error_messages.html.erb
new file mode 100644
index 0000000..c9fdd51
--- /dev/null
+++ b/app/views/common/_error_messages.html.erb
@@ -0,0 +1,11 @@
+<%# http://railscasts.com/episodes/211-validations-in-rails-3 %>
+<% if target.errors.any? %>
+<div id="errorExplanation">
+ <h2><%= pluralize(target.errors.count, "error") %> prohibited this record from being saved:</h2>
+ <ul>
+ <% target.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+</div>
+<% end %>