error message

hi @ all
How can I modify the error messages in the view? Now, in every error
message, I've all time the unessential lines "1 error prohibited this
xxx from being saved" and "There were problems with the following
fields" but I want only the real message (for example "name can't be
blank"). I need the helper error_messages_for :xxx in the views.

Thanks for helping.

If you want something custom you'll probably have to create it
yourself. The error_messages_for macro just iterates through
the .errors collection on the named ActiveRecord object and introduces
it with the line that you want omitted. Something like this will
probably work:

<% unless my_object.errors.empty? %>
<ul>
<% my_object.errors.each_pair do |attr, err| %>
<% content_tag :li, "#{attr.to_s.humanize} #{errors.join(', ')}"
<% end %>
</ul>

Great, thanks for helping...