What is the Rails3 version of errors.add_to_base?

前端 未结 4 1287
情话喂你
情话喂你 2021-02-03 19:46

I want to write a custom validation in Rails 3, but following this example I get:

\'ActiveModel::DeprecatedErrorMethods.add_to_base\' call is deprecated in Rails         


        
4条回答
  •  故里飘歌
    2021-02-03 19:55

    Try to use in below format,

    errors[:base] << "Your Message"

    It wont insert anything before your validation messages.

提交回复
热议问题