Closed rahuldess closed 10 years ago
Hi,
I don't see anything wrong.
You can use this app to compare what with how your code looks like:
try restarting the server - ran into the same problem and that fixed it
I have been getting the same problem with a Rails 4.1 app, where bootstrap-datepicker-rails was being called as a dependancy of a gem. I fixed it by adding this to my app:
require 'bootstrap-datepicker-rails'
@reggieb Where did you add this line require 'bootstrap-datepicker-rails' ? I added the same in application.rb . Still datepicker is not working.
I was working on a engine called wcc_style (private I'm afraid) that had bootstrap-datepicker-rails as a dependency. I put the require statement at the beginning of the engine namespace file lib/wcc_style.rb
I'd suggest putting it in an initializer.
@reggieb Thanks.
@prestonwrthompson I was having the same issue and your suggestion to restart the server saved me from hours of frustration! :)
Same problem here in an engine for rails 4.2.1. Have done the as @reggieb suggested. Works well.
Same problem.
@reggieb - thank you - would you be able to elaborate on what you mean by putting "require 'bootstrap-datepicker-rails' in an initializer?
I'd suggest putting it in an initializer.
@BKSpurgeon If you are using rails, try creating an initializer config/initializers/bootstrap-datepicker-rails.rb
with the content:
require 'bootstrap-datepicker-rails'
It should just get autorequired, if using Rails. Try reloading the app.
I did as mentioned.
Gemfile:
gem 'bootstrap-datepicker-rails' # For showing calender in date fields insane gem 'bootstrap-sass' gem 'jquery-rails' gem 'devise' gem 'carrierwave'
application.css
= require jquery.Jcrop = require_self = require bootstrap-datepicker = require_tree .
application.js
//= require jquery //= require jquery_ujs //= require jquery.Jcrop //= require bootstrap //= require_tree . //= require bootstrap-datepicker
datepick.js
$(document).ready(function(){ $('[data-behaviour~=datepicker]').datepicker(); });
I dint even include the .js file in my view code.. i just wanted to test whether everything is fine till now.. when i run the server ...i get below
Sprockets::FileNotFound in Users#show
Showing /home/rahul/Rails/ORIGINAL/app/views/layouts/profile.html.erb where line #13 raised:
couldn't find file 'bootstrap-datepicker' (in /home/rahul/Rails/ORIGINAL/app/assets/stylesheets/application.css:13)