Вот, пожалуйста,
вид хамла:
%label{:for => "title"} Title
%input#title{:name => "title", :type => "text", :size => "22", :maxlength => "256", :required => true, :placeholder => "Title...", :autofocus => true, :value => @post.title}/
= field_validation(@post, :title)
вспомогательный метод:
def field_validation(target, field)
"<span class=\"field-validation-error\">#{target.errors[field][0]}</span>" unless target.errors[field].empty?
end