I'm using rails 4.1.6 under Ruby 2.1.3, if that's relevant. The gem I'm using is bootstrap-timepicker-rails from https://github.com/tispratik/bootstrap-timepicker-rails.
It's a new project, so I have added very little to it, other than basic functionality I use on every project. All I want is to be able to use timepicker like it's used in the first example of http://jdewit.github.io/bootstrap-timepicker/
So far, I have this in a partial view (from a table inside a form_for):
%tr
%td=f.text_field :time, :class => 'timepicker'
And this on its js.coffee:
$(document).on 'focus', ".timepicker", ->
$(this).timepicker()
And it behaves erratically. The fieldbox that contains the timepicker tries to show a time, but it locks at 12:00 am, and nothing else happens. I tried adding several other classes, including copying the source html code of the example I tried to use, but it doesn't work. No errors on the browser console either.
What am I missing?
Here're my relevant config files:
Gemfile:
gem 'haml-rails'
gem 'hirb'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'jquery-ui-rails'
gem 'autoprefixer-rails'
gem 'bootstrap-datepicker-rails', :require => 'bootstrap-datepicker-rails', :git => 'git://github.com/Nerian/bootstrap-datepicker-rails.git'
gem 'bootstrap-timepicker-rails'
gem 'jquery-datatables-rails', '= 2.1.10.0.3'
application.js
//= require jquery
//= require jquery_ujs
//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require jquery-ui/core
//= require bootstrap-datepicker/core
//= require bootstrap-datepicker/locales/bootstrap-datepicker.es.js
//= require bootstrap-timepicker
//= require bootstrap-sprockets
//= require global
//= require turbolinks
//= require_tree .
application.css
*= require_tree .
*= require_self
*= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
*= require bootstrap-datepicker3
*= require bootstrap_files.css.scss
*= require bootstrap-timepicker
*= require global
Thanks in advance.
EDIT:
Apparently the issue is that I'm using bootstrap3 instead of boostrap2, which the gem I mentioned seems to be designed for. I'm going to search for a gem that can work with bootstrap3; I'll update when/if I find it.