Sha256: 3402c3af3d5308859f7ce9f63d4df528c5a25d17aef82c455bfc7f375ce98419
Contents?: true
Size: 684 Bytes
Versions: 11
Compression:
Stored size: 684 Bytes
Contents
# frozen_string_literal: true 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) %i[label input].include?(namespace) ? {} : super end end end end
Version data entries
11 entries across 11 versions & 1 rubygems