Module: SimpleForm::Components::Errors

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

Instance Method Summary collapse

Instance Method Details

#errorObject



6
7
8
# File 'lib/simple_form/components/errors.rb', line 6

def error
  template.(error_tag, error_text, error_html_options) if has_errors?
end

#error_html_optionsObject



22
23
24
# File 'lib/simple_form/components/errors.rb', line 22

def error_html_options
  html_options_for(:error, [SimpleForm.error_class])
end

#error_methodObject



18
19
20
# File 'lib/simple_form/components/errors.rb', line 18

def error_method
  options[:error_method] || SimpleForm.error_method
end

#error_tagObject



10
11
12
# File 'lib/simple_form/components/errors.rb', line 10

def error_tag
  options[:error_tag] || SimpleForm.error_tag
end

#error_textObject



14
15
16
# File 'lib/simple_form/components/errors.rb', line 14

def error_text
  errors.send(error_method)
end