Module: Formtastic::Inputs::Base::Stringish
- Included in:
- DatePickerInput, DatetimePickerInput, EmailInput, PasswordInput, PhoneInput, SearchInput, StringInput, TimePickerInput, UrlInput
- Defined in:
- lib/formtastic/inputs/base/stringish.rb
Instance Method Summary (collapse)
-
- (Object) input_html_options
Overrides standard
input_html_optionsto provide amaxlengthandsizeattribute. - - (Object) maxlength
- - (Object) size
- - (Object) to_html abstract
- - (Object) wrapper_html_options
Instance Method Details
- (Object) input_html_options
Overrides standard input_html_options to provide a maxlength and size attribute.
15 16 17 18 19 20 |
# File 'lib/formtastic/inputs/base/stringish.rb', line 15 def { :maxlength => maxlength, :size => size }.merge(super) end |
- (Object) maxlength
26 27 28 |
# File 'lib/formtastic/inputs/base/stringish.rb', line 26 def maxlength [:input_html].try(:[], :maxlength) || limit end |
- (Object) size
22 23 24 |
# File 'lib/formtastic/inputs/base/stringish.rb', line 22 def size builder.default_text_field_size end |
- (Object) to_html
This method is abstract.
Override this method in your input class to describe how the input should render itself.
7 8 9 10 11 12 |
# File 'lib/formtastic/inputs/base/stringish.rb', line 7 def to_html input_wrapping do label_html << builder.text_field(method, ) end end |
- (Object) wrapper_html_options
30 31 32 33 |
# File 'lib/formtastic/inputs/base/stringish.rb', line 30 def new_class = [super[:class], "stringish"].compact.join(" ") super.merge(:class => new_class) end |