valid?() public

Checks for errors on an object (i.e., is resource.errors empty?).

Runs all the specified local validations and returns true if no errors were added, otherwise false. Runs local validations (eg those on your Active Resource model), and also any errors returned from the remote system the last time we saved. Remote errors can only be cleared by trying to re-save the resource.


my_person = Person.create(params[:person])
# => true

my_person.errors.add('login', 'can not be empty') if my_person.login == ''
# => false
Show source
Register or log in to add new notes.