class SimpleForm::ErrorNotification
def error_message
def error_message (@message || translate_error_notification).html_safe end
def error_notification_tag
def error_notification_tag SimpleForm.error_notification_tag end
def errors
def errors object.errors end
def has_errors?
def has_errors? object && object.respond_to?(:errors) && errors.present? end
def html_options
def html_options @options[:class] = "#{SimpleForm.error_notification_class} #{@options[:class]}".strip @options end
def initialize(builder, options)
def initialize(builder, options) @builder = builder @message = options.delete(:message) @options = options end
def render
def render if has_errors? template.content_tag(error_notification_tag, error_message, html_options) end end
def translate_error_notification
def translate_error_notification lookups = [] lookups << :"#{object_name}" lookups << :default_message lookups << "Please review the problems below:" I18n.t(lookups.shift, scope: :"simple_form.error_notification", default: lookups) end