method

add_on_blank

Importance_1
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveModel::Errors
add_on_blank(attributes, options = {}) public

Will add an error message to each of the attributes in attributes that is blank (using Object#blank?).

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