我有一個遷移:日期字段和軌道的TextInput
def change
create_table :tasks do |t|
t.date :date, :null => false
end
end
和一個視圖:
<%= form_for @task do |f| %>
<%= f.text_field :date %>
<% end %>
的問題是
爲什麼我有「2011-12 -23 00:00:00「而不是」2011年12月23日「已經在數據庫中的記錄?在數據庫中,它們處於「2011-12-23」格式。
如何內部日期,所以我可以有像「12.23.11」日期。
您正在使用什麼數據庫?我執行了[這些命令](https://gist.github.com/d5c2d25df5988b45e163),設置'root:to => tasks#index',然後創建一個新任務,並且所有事情都按預期工作(即沒有結尾00:00 :00)。 – Alex 2012-01-04 10:14:01