Rails 3.0 中的默认验证错误消息在哪里?
Rails 3.0 中默认的验证错误消息在哪里?例如,ActiveRecord::Error.default_error_messages[:taken] 的等价物是什么?我已经发现 ActiveModel 处理错误而不是 ActiveRecord,但我找不到错误本身。
Where are the default validation error messages in Rails 3.0? What is the equivalent of ActiveRecord::Error.default_error_messages[:taken], for example? I have gotten as far as finding that ActiveModel handles the errors rather than ActiveRecord, but I can't find the errors themselves.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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
更新:
也许您应该尝试添加自己的自定义错误消息?
http://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml
and
http://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml
:D
UPDATE:
Maybe you should try to add your own custom error messages?