Class: SimpleForm::Inputs::StringInput
- Defined in:
- lib/simple_form/inputs/string_input.rb
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#initialize, #input_options, #render
Methods included from SimpleForm::I18nCache
#get_i18n_cache, #i18n_cache, #reset_i18n_cache
Methods included from Components::Wrapper
#wrap, #wrapper_class, #wrapper_error_class, #wrapper_html_options, #wrapper_tag
Methods included from Components::LabelInput
Methods included from Components::Hints
#hint, #hint_html_options, #hint_tag, #hint_text
Methods included from Components::Errors
#error, #error_html_options, #error_method, #error_tag, #error_text
Constructor Details
This class inherits a constructor from SimpleForm::Inputs::Base
Instance Method Details
#input ⇒ Object
4 5 6 |
# File 'lib/simple_form/inputs/string_input.rb', line 4 def input @builder.text_field(attribute_name, ) end |
#input_html_classes ⇒ Object
16 17 18 |
# File 'lib/simple_form/inputs/string_input.rb', line 16 def input_html_classes input_type == :string ? super : super.unshift("string") end |
#input_html_options ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/simple_form/inputs/string_input.rb', line 8 def = super [:size] ||= [limit, SimpleForm.default_input_size].compact.min [:maxlength] ||= limit if limit [:type] ||= input_type unless input_type == :string end |