Module: SimpleForm::Components::Errors

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

Instance Method Summary collapse

Instance Method Details

#errorObject



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

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

#error_html_optionsObject



20
21
22
# File 'lib/simple_form/components/errors.rb', line 20

def error_html_options
  html_options_for(:error, [:error])
end

#error_methodObject



16
17
18
# File 'lib/simple_form/components/errors.rb', line 16

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

#error_tagObject



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

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

#error_textObject



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

def error_text
  errors.send(error_method)
end