Imagine you're a User and you accepts_nested_attributes for
Profile. And your fun developer goes and does something like
this:
@u = User.new @u.build_profile @u.save
...and then
<%= @u.errors.full_messages.each{|e|
"<p>#{e}</p>"} %>
... or something like that, which dumps this nonsense to the
screen:
Profile first name can't be blank
Profile last name can't be blank
Ahh, omg, what is a Profile first name?? Egad, must. get. rid.
of. that.
There's no good reason that I can think of that the class name
should be in the error message. Sometimes it makes phonetic sense
(like in the test suite), but more often than not it ends up just
being confusing for end users. I suggest the error messages in the
above case simply be:
First name can't be blank
Last name can't be blank
Note that this has nothing to do with the error's key name,
which remains "profile.first_name". Form helpers will continue to
wrap labels in an error class.