Sha256: ccfd7cbd9bd86f3274d7fa990f7c55fcdcbcea3b6a4dad217a74c7ddffb45bfe

Contents?: true

Size: 452 Bytes

Versions: 10

Compression:

Stored size: 452 Bytes

Contents

module SimpleForm
  module Wrappers
    # `Single` is an optimization for a wrapper that has only one component.
    class Single < Many
      def initialize(name, options={})
        super(name, [name], options)
      end

      def render(input)
        options = input.options
        if options[namespace] != false
          content = input.send(namespace)
          wrap(input, options, content) if content
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/wrappers/single.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/wrappers/single.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/wrappers/single.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/wrappers/single.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/lib/simple_form/wrappers/single.rb
simple_form-2.0.2 lib/simple_form/wrappers/single.rb
ehoch_simple_form-2.0.2.dev lib/simple_form/wrappers/single.rb
simple_form-2.0.1 lib/simple_form/wrappers/single.rb
simple_form-2.0.0 lib/simple_form/wrappers/single.rb
simple_form-2.0.0.rc lib/simple_form/wrappers/single.rb