rails date field format on error

Posted by ash34 on Stack Overflow See other posts from Stack Overflow or by ash34
Published on 2010-04-01T06:29:38Z Indexed on 2010/04/01 6:33 UTC
Read the original article Hit count: 367

Filed under:
|
|

Hi,

I have an input field that captures a date in my form

<%= f.text_field :from_date, :style => 'width:80px;' %>

The user enters the date in the following format MM/DD/YYYY. However, when there is a validation error in the model and the form is displayed back to the user with the entered values, the date format is converted to YYYY-MM-DD HH:MM:SS UTC. Where do I format this to show MM/DD/YYYY, when the form is displayed to the user.

thanks.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about actionview