Sha256: 2d645127fce9ef5dfcf59b6bc75ee1a9d61d14c20eb1c820a8728bde3d5bc8f4
Contents?: true
Size: 655 Bytes
Versions: 12
Compression:
Stored size: 655 Bytes
Contents
module SimpleForm module Wrappers # `Single` is an optimization for a wrapper that has only one component. class Single < Many def initialize(name, wrapper_options = {}, options = {}) @component = Leaf.new(name, options) super(name, [@component], wrapper_options) end def render(input) options = input.options if options[namespace] != false content = @component.render(input) wrap(input, options, content) if content end end private def html_options(options) [:label, :input].include?(namespace) ? {} : super end end end end
Version data entries
12 entries across 12 versions & 3 rubygems