method

set

Importance_1
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveModel::Errors
set(key, value) public

Set messages for key to value.

person.errors[:name] # => ["cannot be nil"]
person.errors.set(:name, ["can't be nil"])
person.errors[:name] # => ["can't be nil"]
Show source
Register or log in to add new notes.