2010-02-06 21:21:26 +00:00
|
|
|
module SimpleForm
|
|
|
|
module Inputs
|
|
|
|
class NumericInput < Base
|
|
|
|
def input
|
|
|
|
@builder.text_field(attribute_name, input_html_options)
|
|
|
|
end
|
|
|
|
|
|
|
|
def input_html_options
|
|
|
|
input_options = super
|
2010-06-01 21:37:53 +00:00
|
|
|
input_options[:type] ||= "number"
|
2010-02-06 21:21:26 +00:00
|
|
|
input_options[:size] ||= SimpleForm.default_input_size
|
|
|
|
input_options
|
|
|
|
end
|
2010-06-01 21:37:53 +00:00
|
|
|
|
|
|
|
def input_html_classes
|
|
|
|
super.unshift("numeric")
|
|
|
|
end
|
2010-02-06 21:21:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|