Class: SimpleFormWithClientValidation::ErrorNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_form_with_client_validation/error_notification.rb

Instance Method Summary collapse

Constructor Details

#initialize(builder, options) ⇒ ErrorNotification

Returns a new instance of ErrorNotification.



5
6
7
8
9
# File 'lib/simple_form_with_client_validation/error_notification.rb', line 5

def initialize(builder, options)
  @builder = builder
  @message = options.delete(:message)
  @options = options
end

Instance Method Details

#renderObject



11
12
13
14
15
# File 'lib/simple_form_with_client_validation/error_notification.rb', line 11

def render
  if has_errors?
    template.(error_notification_tag, error_message, html_options)
  end
end