vendredi 27 février 2015

text_field with type :date doesn't get bound

This date field:



<%= f.text_field :my_date, id: 'id-123', type: 'date' %>


doesn't get bound to the value of my_date of the model on the, for example, edit page. When I load the page, it's always "empty".


enter image description here


Why is that? I also tried:



<%= f.text_field :my_date, id: 'id-123', type: 'date', value: '11/11/11' %>
<%= f.text_field :my_date, id: 'id-123', type: 'date', value: '11-11-11' %>


and it also didn't work.


Aucun commentaire:

Enregistrer un commentaire