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