Class: Group
- Inherits:
-
BasicField
- Object
- BasicField
- Group
- Defined in:
- lib/formalize/field.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(id, &block) ⇒ Group
constructor
A new instance of Group.
- #input ⇒ Object
Methods inherited from BasicField
#errors, #errors=, #valid?, #validate, #validate_format, #validate_length, #validate_presence, #value, #value=
Methods included from Helpers
#tag, #tag_attributes, #tag_content
Constructor Details
#initialize(id, &block) ⇒ Group
Returns a new instance of Group.
129 130 131 132 133 |
# File 'lib/formalize/field.rb', line 129 def initialize(id, &block) super @choices = [] instance_eval(&block) end |
Instance Method Details
#input ⇒ Object
134 135 136 |
# File 'lib/formalize/field.rb', line 134 def input @choices.collect { |choice| choice.input }.join("\n") end |