Class: Forme::ErrorHandler

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

Overview

Default error handler used by the library, using an “error” class for the input field and a span tag with an “error_message” class for the error message.

Registered as :default.

Instance Method Summary collapse

Instance Method Details

#call(tag, input) ⇒ Object

Return tag with error message span tag after it.



1056
1057
1058
# File 'lib/forme.rb', line 1056

def call(tag, input)
  [tag, input.tag(:span, {:class=>'error_message'}, input.opts[:error])]
end