avatar

28

Add file-wide comments for rdoc's Files section, and add a comment to the FormHelper module explaining the form user experience

by chrisk, 29 Jul, 2007 04:12 AM
20 28  
1 # This file contains the extensions to <tt>ActiveRecord::Base</tt>, contained
2 # in the <tt>TemplatedAttribute::ActiveRecordExtensions</tt> module. See the 
3 # +templated_attribute+[link:classes/TemplatedAttribute/ActiveRecordExtensions/ClassMethods.html]
4 # method.
5 
16 module TemplatedAttribute         # :nodoc:
27   module ActiveRecordExtensions   # :nodoc:
38     
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 
15 module ActionView         #:nodoc:
26   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.
318     module FormHelper
419       
520