Forum: Rails I18n text_field as date

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6b9215975776fd6ee11b80560446086a?d=identicon&s=25 Herman M. (gotzbold)
on 2009-05-24 16:54
Hi Ruby Comuniy!

I have implemented i18n and when I set the locale to "de" everthing
works fine, I mean date_select shows the german date-format.

The problem is, that I want to use a text_field for date-input like:

<%= f.text_field :date_test %>

But when I open the edit.html.erb the date-output is not the "de-fromat"
like 31.12.2008 it is the database format like 2008-12-31.

I tried something like

<%=  l f.text_field :date_test %>

but then I get this error message:

"Object must be a Date, DateTime or Time object"

Do somebody knows a solution?

Thanks ahead!!!

Regs Hermann
This topic is locked and can not be replied to.