Class: SimpleForm::Inputs::NumericInput

Inherits:
Base
  • Object
show all
Defined in:
lib/simple_form/inputs/numeric_input.rb

Constant Summary

Constants inherited from Base

Base::ACTIONS

Instance Attribute Summary

Attributes inherited from Base

#attribute_name, #column, #input_html_options, #input_type, #options, #reflection

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::Placeholders

#placeholder, #placeholder_present?, #placeholder_text

Methods included from Components::LabelInput

included, #label_input

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

#inputObject



4
5
6
7
8
9
10
# File 'lib/simple_form/inputs/numeric_input.rb', line 4

def input
  input_html_options[:type] ||= "number"
  input_html_options[:size] ||= SimpleForm.default_input_size
  input_html_options[:step] ||= 1 if integer?
  infer_attributes_from_validations!
  @builder.text_field(attribute_name, input_html_options)
end

#input_html_classesObject



12
13
14
# File 'lib/simple_form/inputs/numeric_input.rb', line 12

def input_html_classes
  super.unshift("numeric")
end