| Class | FormTestHelper::Field |
| In: |
lib/form_test_helper.rb
|
| Parent: | Object |
| name | [R] | |
| tags | [R] | |
| value | [RW] |
# File lib/form_test_helper.rb, line 206
206: def initialize(tags)
207: @tags = tags
208: reset
209: end
# File lib/form_test_helper.rb, line 215
215: def initial_value
216: if tag['value']
217: tag['value']
218: elsif tag.children
219: tag.children.to_s
220: end
221: end
The name for the field (which may have multiple values) Multiple form elements with the same name are considered only one field. Fields that return multiple values when submitted are indicated with square brackets at the end of their name in HTML, but have no such ending internal to this class.
# File lib/form_test_helper.rb, line 227
227: def name
228: tag['name'].gsub(/\[\]$/, '')
229: end
# File lib/form_test_helper.rb, line 239
239: def proxy
240: returning @value do |value|
241: value.extend(FieldProxy)
242: value.field = self
243: end
244: end