Vì vậy, bạn có thể thay đổi một thông báo lỗi trong en.yml với một cái gì đó như sau:Rails i18n định dạng xác nhận lỗi cụ thể
en:
activerecord:
errors:
models:
foo:
attributes:
amount:
greater_than_or_equal_to: "Custom GTOE error message."
Tuy nhiên, điều này sẽ nói như sau:
Amount Custom GTOE error message.
tôi biết Tôi có thể xóa nó trên toàn cầu với:
en:
activerecord:
errors:
format: "%{message}"
Nhưng tôi có thể khắc phục %{attribute}
chỉ để xác thực này không?
Cảm ơn!
thấy https://github.com/rails/rails/pull/7369, vẫn mở dù –
Cập nhật đến: https://github.com/rails/rails/pull/14260 – juanitofatas