text_field类型:日期不受约束

时间:2015-02-28 01:17:39

标签: ruby-on-rails ruby html5 ruby-on-rails-3

此日期字段:

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

并未绑定到例如编辑页面上模型的my_date的值。当我加载页面时,它总是&#34;空的&#34;。

enter image description here

为什么?我也尝试过:

<%= 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' %>

它也没有用。

0 个答案:

没有答案