Sha256: c4f2a0606ae250794f8e0a43441f7df280b519acfe41bf3f047367c56305d3de

Contents?: true

Size: 670 Bytes

Versions: 47

Compression:

Stored size: 670 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, *@args, html_attributes)
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
dynamic_scaffold-0.10.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.10.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.9.2 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.9.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.9.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.8.5 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.8.4 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.8.3 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.8.2 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.8.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.8.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.7.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.7.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.6.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.6.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.5.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.4.2 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.4.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.4.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-0.3.1 lib/dynamic_scaffold/form/item/single_option.rb