Sha256: 7c812b38cc6d43bc93717be7414b5d63d60f1d5f0c0745e5a4bd0ac4a29035f4
Contents?: true
Size: 687 Bytes
Versions: 6
Compression:
Stored size: 687 Bytes
Contents
module DynamicScaffold module Form module Item class SingleOption < Base def initialize(config, type, *args) name = args.shift html_attributes = args.extract_options! @args = args super(config, type, name, html_attributes) end def render(view, form, classnames = nil) html_attributes = build_html_attributes(classnames) # Retain the value of the password field on error. html_attributes[:value] = form.object.public_send(@name) if @type == :password_field form.public_send(@type, @name, *build_args(view, @args), html_attributes) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems