Ruby on rails 我想要编辑表单中日期字段中的Purchasedate
下面的字段 1.姓名 2.性别 3.价格 4.电子邮件 5.付款 所有数据都存储在数据库中。但购买日期并没有存储在数据库中。编辑用户表单中显示所有字段,但不显示购买日期 _form.html.erb **购买日期**Ruby on rails 我想要编辑表单中日期字段中的Purchasedate,ruby-on-rails,ruby,Ruby On Rails,Ruby,下面的字段 1.姓名 2.性别 3.价格 4.电子邮件 5.付款 所有数据都存储在数据库中。但购买日期并没有存储在数据库中。编辑用户表单中显示所有字段,但不显示购买日期 _form.html.erb **购买日期** <div class="col-md-8"> <%= f.label :purchasedate %><br /> <%= f.text_field :purchasedate ,:value => @purchaseda
<div class="col-md-8">
<%= f.label :purchasedate %><br />
<%= f.text_field :purchasedate ,:value => @purchasedate %>
![enter image description here][1] </div>
我想在数据库中存储购买日期,它的值显示在编辑用户表单中。请帮帮我。@purchasedate%>
使用:value=>@user.purchasedate代替:value=>@purchasedate控制器参数上是否有purchasedate?控制器参数中是否没有更新
create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "gender"
t.integer "price"
t.string "payment"
t.date "purchasedate"
end
end
<div class="col-md-8">
<%= f.label :purchasedate %><br />
<%= f.text_field :purchasedate ,:value => @purchasedate %>
![enter image description here][1] </div>