full_messages_for(attribute)
Instance Public methods
Returns all the full error messages for a given attribute in an array.
class Person validates_presence_of :name, :email validates_length_of :name, in: 5..30 end person = Person.create() person.errors.full_messages_for(:name) # => ["Name is too short (minimum is 5 characters)", "Name can't be blank"]
Please login to continue.