Class: SimpleForm::Wrappers::Single
- Inherits:
-
Many
- Object
- Many
- SimpleForm::Wrappers::Single
- Defined in:
- lib/simple_form/wrappers/single.rb
Overview
`Single` is an optimization for a wrapper that has only one component.
Instance Attribute Summary
Attributes inherited from Many
#components, #defaults, #namespace
Instance Method Summary (collapse)
-
- (Single) initialize(name, options = {})
constructor
A new instance of Single.
- - (Object) render(input)
Methods inherited from Many
Constructor Details
- (Single) initialize(name, options = {})
A new instance of Single
5 6 7 |
# File 'lib/simple_form/wrappers/single.rb', line 5 def initialize(name, ={}) super(name, [name], ) end |
Instance Method Details
- (Object) render(input)
9 10 11 12 13 14 15 |
# File 'lib/simple_form/wrappers/single.rb', line 9 def render(input) = input. if [namespace] != false content = input.send(namespace) wrap(input, , content) if content end end |