0
我是一個努力讓引導程序datetimepicker工作的newby。有人能幫我安裝嗎?Ruby on Rails 4引導日期時間選擇器設置
的application.js
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require turbolinks
//= require_tree .
//= require nested_form_fields
//= require bootstrap-datepicker
//= require bootstrap-datepicker/core
//= require bootstrap-datepicker/locales/bootstrap-datepicker.ru.js
//= require bootstrap-datepicker/locales/bootstrap-datepicker.et.js
//= require moment
//= require bootstrap-datetimepicker
trainings.coffee
$('#training_start_time').datetimepicker({ format: 'dd/mm/yyyy hh:mm' });
視圖
= form_for @training do |f|
...
= f.text_field :start_time, :data => { :provide => 'datetimepicker', date_format: 'dd/mm/yyyy hh:mm' }, :value => f.object.start_time.strftime("%d/%m/%Y %H:%M")
什麼是您所遇到的問題?你是否收到錯誤? –
作爲事實js控制檯matyter顯示錯誤未捕獲TypeError:$(...)。datepicker不是一個函數Uncaught TypeError:$(...)。datetimepicker不是一個函數 –