#24 new
Johannes Bloch

select_tag using I18n.available_locales and I18n.locale

Reported by Johannes Bloch | April 27th, 2009 @ 11:00 PM

Using rails 2.3.2

This select tag will never select a locale because the values in I18n.available_locales are symbols and I18n.locale is String

<%= select_tag 'locale', options_for_select(I18n.available_locales, I18n.locale),:onchange => 'this.form.submit()' %>

You have to rewrite it to

<%= select_tag 'locale', options_for_select(I18n.available_locales, I18n.locale.to_sym),:onchange => 'this.form.submit()' %>

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Repository for collecting Locale data for Ruby on Rails I18n as well as other interesting, Rails related I18n stuff

People watching this ticket

Pages