class Forme::Formatter::Bootstrap5
Private Instance Methods
normalize_options()
click to toggle source
Calls superclass method
Forme::Formatter#normalize_options
# File lib/forme/bs5.rb 34 def normalize_options 35 super 36 37 if @opts[:error] 38 # remove "error" class 39 @attr[:class] = @attr[:class].to_s.sub(/\s*error$/,'') 40 @attr.delete(:class) if @attr[:class].to_s == '' 41 42 Forme.attr_classes(@attr, "is-invalid") 43 end 44 45 if @opts[:help] 46 if @opts[:helper_attr] && @opts[:helper_attr][:id] 47 @attr["aria-describedby"] ||= @opts[:helper_attr][:id] 48 end 49 end 50 end