heartcombo--simple_form/test/support/discovery_inputs.rb

66 lines
1.4 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
2011-04-27 19:26:02 +00:00
class StringInput < SimpleForm::Inputs::StringInput
def input(wrapper_options = nil)
2011-04-27 19:26:02 +00:00
"<section>#{super}</section>".html_safe
end
end
class NumericInput < SimpleForm::Inputs::NumericInput
def input(wrapper_options = nil)
2011-04-27 19:26:02 +00:00
"<section>#{super}</section>".html_safe
end
end
class CustomizedInput < SimpleForm::Inputs::StringInput
def input(wrapper_options = nil)
"<section>#{super}</section>".html_safe
end
def input_method
:text_field
end
end
class DeprecatedInput < SimpleForm::Inputs::StringInput
def input
2011-04-27 19:26:02 +00:00
"<section>#{super}</section>".html_safe
end
2011-09-08 13:28:28 +00:00
2011-04-27 19:26:02 +00:00
def input_method
:text_field
end
2011-09-08 13:28:28 +00:00
end
class CollectionSelectInput < SimpleForm::Inputs::CollectionSelectInput
def input_html_classes
super.push('chosen')
end
end
class FileInput < SimpleForm::Inputs::FileInput
def input_html_classes
2018-09-17 23:56:29 +00:00
super.delete_if { |html_class| html_class == :file }
super.push('file-upload')
end
end
module CustomInputs
class CustomizedInput < SimpleForm::Inputs::StringInput
def input_html_classes
super.push('customized-namespace-custom-input')
end
end
class PasswordInput < SimpleForm::Inputs::PasswordInput
def input_html_classes
super.push('password-custom-input')
end
end
class NumericInput < SimpleForm::Inputs::PasswordInput
def input_html_classes
super.push('numeric-custom-input')
end
end
end