Am 21.07.2012 02:21 schrieb "Ace Suares" <[email protected]>: > > In validations, one can add a custom error message: > >> >> class Person < ActiveRecord::Base >> def a_method_used_for_validation_purposes errors.add(:name, I18n.t(:thekey)) #"cannot contain the characters !@#%*()_-+=") >> end >> end > > > How wil this message be translated when using I18n? > Can a key be passed instead of a message?
That should do it. > Cheers, > ace Hth Norbert -- 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 https://groups.google.com/groups/opt_out.

