# Time\_zone\_select :priority\_zones not working properly

**URL:** <https://www.ruby-forum.com/t/time-zone-select-priority-zones-not-working-properly/187090>\
**Category:** Rails\
**Created:** [April 16, 2010, 7:46pm UTC](https://www.ruby-forum.com/t/time-zone-select-priority-zones-not-working-properly/187090 "2010-04-16T19:46:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anthonys](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a3d4f5/32.png) [@anthonys](https://www.ruby-forum.com/u/anthonys)\
**Post date:** [April 16, 2010, 7:46pm UTC](https://www.ruby-forum.com/t/time-zone-select-priority-zones-not-working-properly/187090/1 "2010-04-16T19:46:52Z")

</div>

I sent this earlier but I don’t think it ever came through. Sorry if  
this is a reposting.

When using :priority\_zones for time\_zone\_select in a manner described  
by the API docs for ActionView::Helpers::FormOptionsHelper I’m getting  
errors.  
Here is an API docs example:  
time\_zone\_select( “user”, ‘time\_zone’, TimeZone.us\_zones, :default =\>  
“Pacific Time (US & Canada)”)

When using this code I get “uninitialized constant  
ActionView::CompiledTemplates::TimeZone”.

The first thing I noticed was that TimeZone is camel cased. This seems  
confusing to me considering TZInfo::Timezone is proper cased. I tried  
using proper cased Timezone and continued to get the same error. Next,  
I tried using TZInfo::Timezone, this worked.

time\_zone\_select( “user”, ‘time\_zone’,  
TZInfo::Timezone.us\_zones, :default =\> “Pacific Time (US & Canada)”)

It seems that I’m either doing it wrong, there is a different way to  
do it in Rails 3.0, the documentation is wrong, or there is a bug  
(understandable since I’m using Rails 3.0 beta).

Can anybody shed light on this?

Documentation:  
[http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelp](http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelp)…

---

<div class="post-metadata">

**Author:** ![anthonys](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a3d4f5/32.png) [@anthonys](https://www.ruby-forum.com/u/anthonys)\
**Post date:** [April 19, 2010, 12:05am UTC](https://www.ruby-forum.com/t/time-zone-select-priority-zones-not-working-properly/187090/2 "2010-04-19T00:05:39Z")

</div>

The documentation might be outdated. Here’s a ticket I found. It  
possibly  
never got updated.

[https://rails.lighthouseapp.com/projects/8994/tickets/2517-time\_zone\_select-documentation-is-outdated](https://rails.lighthouseapp.com/projects/8994/tickets/2517-time_zone_select-documentation-is-outdated)
