OSDN Git Service

merge i18n
[pettanr/pettanr.git] / app / views / system / _error_explanation.html.erb
diff --git a/app/views/system/_error_explanation.html.erb b/app/views/system/_error_explanation.html.erb
new file mode 100644 (file)
index 0000000..2043c07
--- /dev/null
@@ -0,0 +1,18 @@
+<% if obj.errors.any? %>
+  <div id="error_explanation">
+    <h2>
+    <%= 
+      if obj.errors.size == 1
+        t('activerecord.errors.template.header.one', :model => obj.class.model_name.human)
+      else
+        t('activerecord.errors.template.header.other', :model => obj.class.model_name.human, :count => obj.errors.size)
+      end 
+    %>
+    </h2>
+    <ul>
+      <% obj.errors.full_messages.each do |msg| %>
+        <li><%= msg %></li>
+      <% end %>
+    </ul>
+  </div>
+<% end %>