|
|
| 19 |
28 |
|
| 1 | # This file contains the extensions to ActionView::Helpers::FormHelper: |
| 2 | # +text_area_with_templating+[link:classes/ActionView/Helpers/FormHelper.html] |
| 3 | # and +text_field_with_templating+[link:classes/ActionView/Helpers/FormHelper.html]. |
| 4 | |
| 1 | 5 | module ActionView #:nodoc: |
| 2 | 6 | module Helpers #:nodoc: |
| 7 | |
| 8 | |
| 9 | # Forms which have fields for templated attributes have the following behavior: |
| 10 | # * When the user visits the form, the field is pre-filled with a |
| 11 | # template value (like <tt>http://</tt>) if the real value is empty or +nil+. |
| 12 | # * If the template is left unchanged, it's convert it to +nil+ before validation. |
| 13 | # * To imply that the initial value is a suggestion, the field's text color is |
| 14 | # gray until the user makes a change. If the user's only change is to empty |
| 15 | # the field, we should reset it to the template value and gray again on blur. |
| 16 | # * In addition to this, <tt>label</tt>-style templates blank their fields |
| 17 | # (removing the template value) when they receive focus. |
| 3 | 18 | module FormHelper |
| 4 | 19 | |
| 5 | 20 | |