Sha256: fea9e7912af07196fefc2341b1b909daeeee44c66768ac6e53e61ae3b6176092

Contents?: true

Size: 664 Bytes

Versions: 36

Compression:

Stored size: 664 Bytes

Contents

module UiBibzInputs
  class StringInput < BaseInput

      enable :placeholder, :maxlength, :minlength, :pattern

      def input(wrapper_options = nil)
        unless string?
          input_html_classes.unshift("string")
          input_html_options[:type] ||= input_type if html5?
        end

        merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)

        @builder.text_field(attribute_name, merged_input_options)
      end

      def options
        super.merge({ value: @builder.object.send(attribute_name) || super[:value] })
      end

      private

      def string?
        input_type == :string
      end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ui_bibz-2.4.0 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.15 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.14 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.13 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.12 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.11 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.10 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.9 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.8 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.7 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.6 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.5 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.4 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.3 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.2 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.1 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.3.0 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.2.2 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.2.1 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb
ui_bibz-2.2.0 lib/ui_bibz/inputs/ui_bibz_inputs/string_input.rb