method

add_on_empty

Importance_1
v4.1.8 - Show latest stable - 0 notes - Class: ActiveModel::Errors
add_on_empty(attributes, options = {}) public

Will add an error message to each of the attributes in attributes that is empty.

person.errors.add_on_empty(:name)
person.errors.messages
# => {:name=>["can't be empty"]}
Show source
Register or log in to add new notes.