Class: DeltaInput
- Inherits:
-
SimpleForm::Inputs::StringInput
- Object
- SimpleForm::Inputs::StringInput
- DeltaInput
- Defined in:
- app/inputs/delta_input.rb
Instance Method Summary collapse
-
#input(wrapper_options) ⇒ Object
for now, need to pass id or it won’t work.
Instance Method Details
#input(wrapper_options) ⇒ Object
for now, need to pass id or it won’t work
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/inputs/delta_input.rb', line 3 def input() = (, ) [:type] = 'text' [:data] ||= {} [:data][:delta] ||= 1 [:autocomplete] ||= 'off' # TODO: get generated id, don't know how yet - `add_default_name_and_id_for_value` might be an option template.content_tag :div, class: 'delta-input input-prepend input-append' do (content_tag(:i, nil, class: 'icon icon-minus'), -1, ) + @builder.text_field(attribute_name, ) + (content_tag(:i, nil, class: 'icon icon-plus'), 1, ) end end |