I'm trying to create custom error messages and in doing so I thought I
could access the validation errors each_key method. I know each_key
isn't listed as a method for errors object but errors object is a hash
right? When I look at the source of each method
def each
@errors.each_key { |attr| @errors[attr].each { |msg| yield attr, msg }
}
end
each_key is being used but when I access it directly, it barfed with
undefined method error. Anyone knows why? Thanks in advance for your
help.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---