Rails 3.0中的默认验证错误消息在哪里?例如,相当于ActiveRecord :: Error.default_error_messages [:taken]?我已经找到ActiveModel处理错误而不是ActiveRecord,但我找不到错误本身.
解决方法
http://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml
和
http://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml
:D
更新:
# de.yml activerecord: errors: messages: taken: "ist bereits vergeben" # test_spec.rb ... assert_equal(object.errors[field],I18n.t("activerecord.errors.messages.taken")) ...