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-1.8.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.8.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.7.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.7.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.6.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.5.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.4.3 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.4.2 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.4.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.4.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.3.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.2.2 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.2.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.2.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.1.4 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.1.3 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.1.2 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.1.1 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.1.0 lib/dynamic_scaffold/form/item/single_option.rb
dynamic_scaffold-1.0.0 lib/dynamic_scaffold/form/item/single_option.rb