module Formtastic::Inputs::Base::Stringish
Public Instance Methods
input_html_options()
click to toggle source
Overrides standard `input_html_options` to provide a `maxlength` and `size` attribute.
Calls superclass method
# File lib/formtastic/inputs/base/stringish.rb, line 15 def input_html_options { :maxlength => maxlength, :size => size }.merge(super) end
maxlength()
click to toggle source
# File lib/formtastic/inputs/base/stringish.rb, line 26 def maxlength options[:input_html].try(:[], :maxlength) || limit end
size()
click to toggle source
# File lib/formtastic/inputs/base/stringish.rb, line 22 def size builder.default_text_field_size end
to_html()
click to toggle source
@abstract Override this method in your input class to describe how the input should render itself.
# File lib/formtastic/inputs/base/stringish.rb, line 7 def to_html input_wrapping do label_html << builder.text_field(method, input_html_options) end end
wrapper_html_options()
click to toggle source
Calls superclass method
# File lib/formtastic/inputs/base/stringish.rb, line 30 def wrapper_html_options new_class = [super[:class], "stringish"].compact.join(" ") super.merge(:class => new_class) end