Why doesn't Rails' “errors.full_messages” replace attribute and message variables?

后端 未结 8 1697
小鲜肉
小鲜肉 2020-12-09 16:22

Having a strange problem with a rails model I just created.

Here are my validations:

validates_presence_of :from_name, :message => \'Please provid         


        
8条回答
  •  悲哀的现实
    2020-12-09 17:12

    Here's my complete config/locales/en.yml that solves the attribute, message, count, and model issues. I got this from the RoR docs here: http://guides.rubyonrails.org/i18n.html

    en: activerecord: errors: full_messages: format: "%{attribute} %{message}" template: header: one: "1 error prohibited this %{model} from being saved" other: "%{count} errors prohibited this %{model} from being saved"

提交回复
热议问题