Forum: Rails I18n text_field as date

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F87d150876b608711d5fc8154a8038c9?d=identicon&s=25 Herman Müller (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.