Sha256: 9bc9f6c9e9c04eabcec193d87f5aff7b8a15ced6201fb2f2e0daa299ab553e5d

Contents?: true

Size: 557 Bytes

Versions: 7

Compression:

Stored size: 557 Bytes

Contents

module SimpleForm
  module Inputs
    class BooleanInput < Base
      def input
        @builder.check_box(attribute_name, input_html_options)
      end

      def label_input
        input + (options[:label] == false ? "" : label)
      end

    protected

      # Booleans are not required by default because in most of the cases
      # it makes no sense marking them as required. The only exception is
      # Terms of Use usually presented at most sites sign up screen.
      def attribute_required_by_default?
        false
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_form-1.4.2 lib/simple_form/inputs/boolean_input.rb
simple_form-1.4.1 lib/simple_form/inputs/boolean_input.rb
simple_form-1.4.0 lib/simple_form/inputs/boolean_input.rb
simple_form-1.3.1 lib/simple_form/inputs/boolean_input.rb
simple_form-1.3.0 lib/simple_form/inputs/boolean_input.rb
simple_form-1.2.2 lib/simple_form/inputs/boolean_input.rb
simple_form-1.2.1 lib/simple_form/inputs/boolean_input.rb