Module: SimpleForm::Components::Errors

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

Instance Method Summary collapse

Instance Method Details

#error(wrapper_options = nil) ⇒ Object



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

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

#full_error(wrapper_options = nil) ⇒ Object



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

#has_errors?Boolean

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