app/views/categories/_form.html.haml
= form_for @category do |f|
-if @category.errors.any?
#error_explanation
%h2= "#{pluralize(@category.errors.count, "error")} prohibited this category from being saved:"
%ul
- @category.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :name
= f.text_field :name
.actions
= f.submit 'Save'