Sha256: 4cc4b5449ceeffd46529d1d19c954ea325b60b8d6c018314d618cd18e21ddb9b

Contents?: true

Size: 535 Bytes

Versions: 19

Compression:

Stored size: 535 Bytes

Contents

module SimpleForm
  module Components
    module HTML5
      def initialize(*)
        @html5 = false
      end

      def html5
        @html5 = true
        input_html_options[:required] = true if has_required?
        nil
      end

      def html5?
        @html5
      end

      def has_required?
        # We need to check browser_validations because
        # some browsers are still checking required even
        # if novalidate was given.
        required_field? && SimpleForm.browser_validations
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
simple_form-2.1.3 lib/simple_form/components/html5.rb
simple_form-2.1.2 lib/simple_form/components/html5.rb
simple_form-2.1.1 lib/simple_form/components/html5.rb
simple_form_awesome-2.3.0 lib/simple_form/components/html5.rb
simple_form_awesome-2.2.0 lib/simple_form/components/html5.rb
simple_form-2.1.0 lib/simple_form/components/html5.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.4/lib/simple_form/components/html5.rb
simple_form-2.0.4 lib/simple_form/components/html5.rb
simple_form-2.0.3 lib/simple_form/components/html5.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/html5.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/html5.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/html5.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/html5.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/components/html5.rb
simple_form-2.0.2 lib/simple_form/components/html5.rb
ehoch_simple_form-2.0.2.dev lib/simple_form/components/html5.rb
simple_form-2.0.1 lib/simple_form/components/html5.rb
simple_form-2.0.0 lib/simple_form/components/html5.rb
simple_form-2.0.0.rc lib/simple_form/components/html5.rb