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 object && errors.present?
end

#error_html_optionsObject



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

def error_html_options
  html_options_for(:error, :error)
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.to_sentence
end