diff options
author | gbuesing <gbuesing@gmail.com> | 2008-05-18 10:25:29 -0500 |
---|---|---|
committer | gbuesing <gbuesing@gmail.com> | 2008-05-18 10:25:29 -0500 |
commit | 0f333449bd47737a7260d7b9770a2bc50a373abb (patch) | |
tree | 474ff49a1fc266573c5fd0e13ff28ad13db72b5a /actionpack/lib/action_view | |
parent | 2463e38efd3cbcc10e7b0a93ad9c2d2224340668 (diff) | |
download | rails-0f333449bd47737a7260d7b9770a2bc50a373abb.tar.gz rails-0f333449bd47737a7260d7b9770a2bc50a373abb.tar.bz2 rails-0f333449bd47737a7260d7b9770a2bc50a373abb.zip |
time_zone_select docs: explain priority zones option. Add example showing a custom set of priority zones.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index bf65fe5574..6f3818659e 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -146,6 +146,12 @@ module ActionView # to TimeZone. This may be used by users to specify a different time # zone model object. (See #time_zone_options_for_select for more # information.) + # + # You can also supply an array of TimeZone objects + # as +priority_zones+, so that they will be listed above the rest of the + # (long) list. (You can use TimeZone.us_zones as a convenience for + # obtaining a list of the US time zones.) + # # Finally, this method supports a <tt>:default</tt> option, which selects # a default TimeZone if the object's time zone is nil. # @@ -156,6 +162,8 @@ module ActionView # # time_zone_select( "user", 'time_zone', TimeZone.us_zones, :default => "Pacific Time (US & Canada)") # + # time_zone_select( "user", 'time_zone', [ TimeZone['Alaska'], TimeZone['Hawaii'] ]) + # # time_zone_select( "user", "time_zone", TZInfo::Timezone.all.sort, :model => TZInfo::Timezone) def time_zone_select(object, method, priority_zones = nil, options = {}, html_options = {}) InstanceTag.new(object, method, self, nil, options.delete(:object)).to_time_zone_select_tag(priority_zones, options, html_options) |