Permalink
Browse files

time_zone_select docs: explain priority zones option. Add example sho…

…wing a custom set of priority zones.
  • Loading branch information...
1 parent 2463e38 commit 0f333449bd47737a7260d7b9770a2bc50a373abb @gbuesing gbuesing committed May 18, 2008
Showing with 8 additions and 0 deletions.
  1. +8 −0 actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -146,6 +146,12 @@ def country_select(object, method, priority_countries = nil, options = {}, html_
# 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 @@ def country_select(object, method, priority_countries = nil, options = {}, html_
#
# 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)

0 comments on commit 0f33344

Please sign in to comment.