Datepicker正在選擇日期,但它不會將其保存到我的數據庫。嘗試下面的代碼中顯示的幾個選項,但它仍然無法正常工作。此代碼給我一個錯誤。如何正確格式化f.text_field?語法錯誤日期選擇器
<div class="form-group">
<label class="control-label col-sm-5" for="time_stop">Job Date:</label>
<div class="col-sm-7">
<%= f.text_field :jobdate, :id => @appointment.jobdate, "data-provide" => 'datepicker', @appointment.jobdate, class: "form-control" %>
</div>
<script>
$(function() {
$("#jobdate").datepicker();
});
</script>
</div>
錯誤消息:
/home/ubuntu/workspace/agss/app/views/appointments/_form.html.erb:95: 語法錯誤,意想不到的 '',期待=> ... epicker」, @ appointment.jobdate,類: 「形式控制」); @出來......^
錯誤消息:/home/ubuntu/workspace/agss/app/views/appointments/_form.html.erb:95:語法錯誤,意外的',',期待=> ... epicker',@appointment。 jobdate,class:「form-control」); @ out ... ...^ – Nuanes