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

On Fri, Apr 16, 2010 at 1:44 PM, Anthony Smith <[email protected]>wrote:

> 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://www.google.com/url?sa=D&q=http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html%23M001626&usg=AFQjCNFi_qvq-Tyc48ej5kWzDa1Yr80dKw>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to