Module: Formular::Element::Modules::Error::InstanceMethods

Defined in:
lib/formular/element/modules/error.rb

Overview

options functionality (same as SimpleForm): options == false NO ERROR regardless of model errors options == String return the string, regardless of model errors

Instance Method Summary collapse

Instance Method Details

#error_textObject



14
15
16
# File 'lib/formular/element/modules/error.rb', line 14

def error_text
  has_custom_error? ? options[:error] : errors_on_attribute.send(error_method) if has_errors?
end

#has_errors?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/formular/element/modules/error.rb', line 18

def has_errors?
  options[:error] != false && (has_custom_error? || has_attribute_errors?)
end