Flowdock
method

invalid?

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActiveResource::Errors

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

These similar methods exist in v6.1.7.7:

invalid?(attribute) public

Returns true if the specified attribute has errors associated with it.

Examples

  my_resource = Disk.find(1)
  my_resource.errors.add('location', 'must be Main') unless my_resource.location == 'Main'
  my_resource.errors.on('location')
  # => 'must be Main!'

  my_resource.errors.invalid?('location')
  # => true
  my_resource.errors.invalid?('name')
  # => false
Show source
Register or log in to add new notes.