Parent

Files

SimpleForm::Inputs::StringInput

Public Instance Methods

input() click to toggle source
# File lib/simple_form/inputs/string_input.rb, line 4
def input
  @builder.text_field(attribute_name, input_html_options)
end
input_html_classes() click to toggle source
# 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() click to toggle source
# File lib/simple_form/inputs/string_input.rb, line 8
def input_html_options
  input_options = super
  input_options[:size]      ||= [limit, SimpleForm.default_input_size].compact.min
  input_options[:maxlength] ||= limit if limit
  input_options[:type]      ||= input_type unless input_type == :string
  input_options
end

Protected Instance Methods

limit() click to toggle source
# File lib/simple_form/inputs/string_input.rb, line 22
def limit
  column && column.limit
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.