Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing default error messages in Rails

Our client has decided 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?

like image 592
Neil Middleton Avatar asked Dec 14 '22 02:12

Neil Middleton


1 Answers

Use config/locales/en.yml

Specifically, put the following in that file:

en:
  activerecord:
    errors:
      messages:
        blank: "must be completed"
like image 144
James A. Rosen Avatar answered Dec 31 '22 02:12

James A. Rosen