How can I handle translation of my custom errors validation? Can I pass a symbol and then do something in my yaml files? 开发者_如何学GoHere is my code:
def validate
errors.add(:kind, "something i want to translate") unless KINDS.include?(kind)
end
Greg
I found out.
errors.add(:kind, I18n.t(:key, :scope => [:activerecord, :model]) unless KINDS.include?(kind)
精彩评论