Sha256: 7e0d43e802afdb3c65d4c068f2ac03593cdaef2cb13d6a56f7b154bb26be7939

Contents?: true

Size: 698 Bytes

Versions: 17

Compression:

Stored size: 698 Bytes

Contents

module TaoForm
  module Inputs
    class NumericInput < ::SimpleForm::Inputs::NumericInput

      def input(wrapper_options = nil)
        origin_input = super
        prefix = options[:prefix].present? ? @builder.label(@attribute_name, options[:prefix], class: 'prefix') : ''
        suffix = options[:suffix].present? ? @builder.label(@attribute_name, options[:suffix], class: 'suffix') : ''

        field_class = ['text-field']
        field_class << 'text-field-with-prefix' if prefix.present?
        field_class << 'text-field-with-suffix' if suffix.present?

        template.content_tag(:div, "#{prefix}#{origin_input}#{suffix}".html_safe, class: field_class)
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
tao_form-1.0.0.beta.2 lib/tao_form/inputs/numeric_input.rb
tao_form-1.0.0.beta.1 lib/tao_form/inputs/numeric_input.rb
tao_form-0.2.3 lib/tao_form/inputs/numeric_input.rb
tao_form-0.2.2 lib/tao_form/inputs/numeric_input.rb
tao_form-0.2.1 lib/tao_form/inputs/numeric_input.rb
tao_form-0.2.0 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.10 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.9 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.8 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.7 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.6 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.5 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.4 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.3 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.2 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.1 lib/tao_form/inputs/numeric_input.rb
tao_form-0.1.0 lib/tao_form/inputs/numeric_input.rb