diff options
Diffstat (limited to 'app/views/common')
-rw-r--r-- | app/views/common/_error_messages.html.erb | 11 |
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..731f62c --- /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 form from being submitted:</h2> + <ul> + <% target.errors.full_messages.each do |msg| %> + <li><%= msg %></li> + <% end %> + </ul> +</div> +<% end %> |