def errors
      found_errors = @record.all('[data-error-for]')
      error_list = ActiveModel::Errors.new(self)
      found_errors.each do | error |
        attribute = error['data-error-for']
        message = error.text
        error_list.add(attribute, message)
      end
      error_list
    end
def errors
      found_errors = @record.all('[data-error-for]')
      error_list = ActiveModel::Errors.new(self)
      found_errors.each do | error |
        attribute = error['data-error-for']
        message = error.text
        error_list.add(attribute, message)
      end
      error_list
    end
Searches the record for any errors and returns them

 @return [ActiveModel::Errors] the error object for the current record

 @raise [AttributeNotFound] when the attribute is not found in the record