开发者

Changing default error messages in Rails

开发者 https://www.devze.com 2022-12-08 04:58 出处:网络
Our client has d开发者_如何学运维ecided that they would like all blank AR error messages to be changed from \"can\'t be blank\" to \"must be completed\" throughout the entire app.

Our client has d开发者_如何学运维ecided that they would like all blank AR error messages to be changed from "can't be blank" to "must be completed" throughout the entire app.

What's the easiest Rails'y way of doing this?


Use config/locales/en.yml

Specifically, put the following in that file:

en:
  activerecord:
    errors:
      messages:
        blank: "must be completed"
0

精彩评论

暂无评论...
验证码 换一张
取 消