module FormtasticRebootstrap::Inputs::Base::Html

Public Instance Methods

form_control_input_html_options() click to toggle source
# File lib/formtastic_rebootstrap/inputs/base/html.rb, line 8
def form_control_input_html_options
  new_classes = input_class_without_col&.compact&.join(" ")
  input_html_options.merge(:class => new_classes)
end
input_class_without_col() click to toggle source
# File lib/formtastic_rebootstrap/inputs/base/html.rb, line 17
def input_class_without_col
  ['form-control'] <<  original_classes&.reject do |c|
    c.match(/^col-(sm|md|lg|xl)?-?[0-9]{1,2}/)
  end&.join(' ')
end
input_html_options() click to toggle source
Calls superclass method
# File lib/formtastic_rebootstrap/inputs/base/html.rb, line 23
def input_html_options
  if errors?
    {
      :class => "error"
    }.merge(super)
  else
    super
  end
end
original_classes() click to toggle source
# File lib/formtastic_rebootstrap/inputs/base/html.rb, line 13
def original_classes
  input_html_options[:class]&.split(' ')&.flatten
end