
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()' %>
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
- Nobody is watching this ticket.