Sha256: 90607fabbbe0a7ad0d767cc4c08d695bb76b8679f79537bf5f45c276c3c00db3

Contents?: true

Size: 1.03 KB

Versions: 64

Compression:

Stored size: 1.03 KB

Contents

module BootstrapForm
  module Helpers
    module Bootstrap4

      def submit(name = nil, options = {})
        options.reverse_merge! class: 'btn btn-secondary'
        super(name, options)
      end


      # TODO check upstream - append tag options
      def prepend_and_append_input(name, options, &block)
        options = options.extract!(:prepend, :append, :input_group_class, :append_tag, :input_group)
        input_group_class = ["input-group", options[:input_group_class]].compact.join(' ')

        input = capture(&block) || "".html_safe

        input = content_tag(:div, input_group_content(options[:prepend]), class: 'input-group-prepend') + input if options[:prepend]
        input << content_tag(:div, input_group_content(options[:append]), (options[:append_tag] || {}).merge(class: 'input-group-append')) if options[:append]
        input << generate_error(name)
        input = content_tag(:div, input, (options[:input_group] || {}).merge(class: input_group_class)) unless options.empty?
        input
      end

    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha15 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha14 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha13 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha12 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha11 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha10 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha9 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha8 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha7 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha6 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha5 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha4 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.4.5 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.4.4 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha3 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha2 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.5.0.alpha1 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.4.3 lib/bootstrap_form/helpers/bootstrap4.rb
egov_utils-1.4.2 lib/bootstrap_form/helpers/bootstrap4.rb