Class: SimpleForm::Tailwind::Inputs::PrependStringInput

Inherits:
Inputs::StringInput
  • Object
show all
Includes:
OverwriteClassWithErrorOrValidClass
Defined in:
lib/simple_form/tailwind/inputs/prepend_string_input.rb

Instance Method Summary collapse

Methods included from OverwriteClassWithErrorOrValidClass

#set_input_classes

Instance Method Details

#input(*args, &blk) ⇒ Object



11
12
13
14
15
# File 'lib/simple_form/tailwind/inputs/prepend_string_input.rb', line 11

def input(*args, &blk)
  input_html_options[:type] ||= "text"

  super
end

#prepend(wrapper_options = nil) ⇒ Object



17
18
19
# File 'lib/simple_form/tailwind/inputs/prepend_string_input.rb', line 17

def prepend(wrapper_options = nil)
  template.(:span, options[:prepend], class: "inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm")
end