method

valid?

Importance_1
v2.0.3 - Show latest stable - 0 notes - Class: ActiveResource::Validations
valid?() public

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

Examples

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

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