Sha256: 3d01e4ddda2b384166abb063e3e82aac0a8f2e31dd2812be1ceba7f607d852be
Contents?: true
Size: 849 Bytes
Versions: 47
Compression:
Stored size: 849 Bytes
Contents
module DynamicScaffold module Form module Item class TwoOptions < Base def initialize(config, type, *args) name = args.shift # rubocop:disable Style/IdenticalConditionalBranches if args[args.length - 2].is_a?(Hash) html_attributes = args.extract_options! @options = args.extract_options! else html_attributes = {} @options = args.extract_options! end # rubocop:enable Style/IdenticalConditionalBranches @args = args super(config, type, name, html_attributes) end def render(_view, form, classnames = nil) html_attributes = build_html_attributes(classnames) form.public_send(@type, @name, *@args, @options, html_attributes) end end end end end
Version data entries
47 entries across 47 versions & 1 rubygems