Public Instance methods
call(tag, input)
[show source]
# File lib/forme/transformers/error_handler.rb 51 def call(tag, input) 52 if tag.is_a?(Array) && tag.first.is_a?(Tag) && tag.first.type == :legend 53 first_input = input.opts[:first_input] 54 attr = first_input.opts[:attr] ||= {} 55 Forme.attr_classes(attr, 'error') 56 attr['aria-invalid'] = 'true' 57 attr['aria-describedby'] = input.opts[:error_id] = "#{first_input.opts[:id]}_error_message" 58 59 tag.insert(1, error_tag(input)) 60 else 61 super 62 end 63 end