Module: SimpleForm::Components::Errors

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) error



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

def error
  error_text if has_errors?
end

- (Boolean) has_errors?

Returns:

  • (Boolean)


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

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