Reputation: 97
I want change format date in a textfield in my form, but show this error
undefined method `strftime' for :fecha:Symbol
This is my code
<%= f.text_field :fecha.strftime("%d/%m/%Y") %>
any suggestion?
Upvotes: 0
Views: 29
Reputation: 29349
try this
<%= f.text_field :fecha, :value => @object.facha.strftime("%d/%m/%Y") %>
@object
will be the object for which you are creating a form
for eg
<%= form_for @object %>
Upvotes: 1