Anybody knows how to setup the gem bootstrap-datepicker-rails? I followed the steps in http://rubydoc.info/gems/bootstrap-datepicker-rails/0.6.21/frames, basically:
- I setup
twitter-bootstrap-rails
gem - I add this to gemfile
gem 'bootstrap-datepicker-rails', '>= 0.6.21'
Add this line to app/assets/stylesheets/application.css
*= require bootstrap-datepicker
Add this line to app/assets/javascripts/application.js
//= require bootstrap-datepicker
Add this line to app/assets/javascripts/controllername.js.coffee
$('.datepicker').datepicker()
Finally use in view :)
<input type="text" data-behaviour='datepicker' >
But it doesn't work!! Anybody has got it to work? It should work nice as shown here:
http://jsfiddle.net/2Gg5k/43/
I did the same, but I change the code:
By this code:
I try using a class 'datapicker' but not found.
This is my example, I use to HAML and coffeescript
events.js.coffe
_form.haml
Look at step 5 and step 6, your selection class
.datepicker
in javascript but not ininput field
Try this
on views (e.g form)
Or As component :
Example above all if the attribute using
date
type. You can use bootstrap-datetimepicker-rails gem, if the attribute usingdatetime
type