Module: SimpleFormWithClientValidation::Components::Errors

Included in:
Inputs::Base
Defined in:
lib/simple_form_with_client_validation/components/errors.rb

Instance Method Summary collapse

Instance Method Details

#errorObject



4
5
6
# File 'lib/simple_form_with_client_validation/components/errors.rb', line 4

def error
  error_text if has_errors?
end

#has_errors?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/simple_form_with_client_validation/components/errors.rb', line 8

def has_errors?
  object && object.respond_to?(:errors) && errors.present?
end