| Class | FormTestHelper::Field |
| In: |
lib/form_test_helper.rb
|
| Parent: | Object |
| name | [R] | |
| tags | [R] | |
| value | [RW] |
# File lib/form_test_helper.rb, line 205
205: def initialize(tags)
206: @tags = tags
207: reset
208: end
# File lib/form_test_helper.rb, line 214
214: def initial_value
215: if tag['value']
216: tag['value']
217: elsif tag.children
218: tag.children.to_s
219: end
220: 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 226
226: def name
227: tag['name'].gsub(/\[\]$/, '')
228: end
# File lib/form_test_helper.rb, line 238
238: def proxy
239: returning @value do |value|
240: value.extend(FieldProxy)
241: value.field = self
242: end
243: end