#12 new
YavorIvanov

i18n and date_select exception

Reported by YavorIvanov | February 10th, 2009 @ 01:10 PM

When migrating a current project from GetText to i18n the following exception was thrown when using the date_select helper:

can't convert Symbol into String

Example:

When in your application you have set the I18n.locale to something different than "en" and you have the following simple code in your view:


<%= date_select("user_info", "birthdate") %>

You'll get the can't convert Symbol into String for the date_select helper. The problem can be rescued by giving the date_select helper order like this:


<%= date_select("user_info", "birthdate", :order => [:day,:month,:year]) %>

or by doing order in the yml file usually located at config/locales/your_lang.yml like this


date:
  formats: 
    default: ""
    long: ""
    short: ""
  order: [ :day, :month, :year ]

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 ยป

Internationalization API for Ruby.

This library is used in Ruby on Rails but also suited for use in other contexts.

Attachments

Pages