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(wrapper_options = nil)



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

def error(wrapper_options = nil)
  error_text if has_errors?
end

- (Object) full_error(wrapper_options = nil)



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

def full_error(wrapper_options = nil)
  full_error_text if options[:error] != false && has_errors?
end

- (Boolean) has_errors?

Returns:

  • (Boolean)


12
13
14
# File 'lib/simple_form/components/errors.rb', line 12

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