# File lib/simple_form/components/errors.rb, line 4 def error error_text if has_errors? end
# File lib/simple_form/components/errors.rb, line 8 def has_errors? object && object.respond_to?(:errors) && errors.present? end
# File lib/simple_form/components/errors.rb, line 18 def error_method options[:error_method] || SimpleForm.error_method end
# File lib/simple_form/components/errors.rb, line 14 def error_text "#{options[:error_prefix]} #{errors.send(error_method)}".lstrip.html_safe end
# File lib/simple_form/components/errors.rb, line 22 def errors @errors ||= (errors_on_attribute + errors_on_association).compact end
# File lib/simple_form/components/errors.rb, line 30 def errors_on_association reflection ? object.errors[reflection.name] : [] end
# File lib/simple_form/components/errors.rb, line 26 def errors_on_attribute object.errors[attribute_name] end