Reputation: 171341
My object got by default today's date:
class MyController < ApplicationController
def new
@obj.my_date = Date.today
end
end
and then, in my "new object" form it is displayed like this:
<%= f.text_field(:my_date) %>
It looks like this: 2011-02-24
I guess it is because of the default to_s
method of Date
.
Is that possible to render it like 24/02/2011
without overriding the to_s
method of Date
?
Upvotes: 0
Views: 1975