Class: Yaks::Resource::Form::Field
- Inherits:
-
Object
- Object
- Yaks::Resource::Form::Field
- Defined in:
- lib/yaks/resource/form/field.rb,
lib/yaks/resource/form/field/option.rb
Defined Under Namespace
Classes: Option
Instance Method Summary collapse
Instance Method Details
#value ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/yaks/resource/form/field.rb', line 8 def value if type.equal? :select selected = .find(&:selected) selected.value if selected else @value end end |
#with_value(value) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/yaks/resource/form/field.rb', line 17 def with_value(value) if type.equal? :select with(options: (value)) else with(value: value) end end |