Can't require jquery-ui in rails app, fake name doesn't cause an error -
i'm trying use jquery-ui-rails in rails app (running spree 3.0).
$ bundle list | grep jq * jquery-rails (4.0.5) * jquery-ui-rails (5.0.5) no matter do, can't seem jquery-ui load (neither css or js file). things i've tried in app/assets/javascripts/application.js:
//= require jquery-ui //= require jquery-ui/menu //= require jquery.ui.all none of these seemed make difference, , tried
//= require file-that-does-not-exist and saw no error. what's going on here? file being loaded?
this not proper way add assets when using spree. spree's main layout not include application.js file! proper way include more assets documented here: https://guides.spreecommerce.com/developer/asset.html
in short, add require statements app/assets/javascripts/spree/frontend/all.js. file loaded spree. if want add backend well, add app/assets/javascripts/spree/backend/all.js. stylesheets go in app/assets/stylesheets/spree/frontend/all.js , app/assets/stylesheets/spree/backend/all.js might expect. may want add
//= require application to all.js files and
/* *= require application */ to all.css files make things behave expected, or add warning top of application files like:
!!!!! file not loaded spree. adding things here nothing !!!!! it may save hours , hours of work in future.
Comments
Post a Comment