jquery - Ruby on Rails 4: How to include Javascript files in Rails web application? -


i building rails 4 web application , want include .js files application . possible directly add javascript file rails ..app/assets/javascripts folder , add reference in application.js like

//= customejsfile.js  

is right way . if yes possible me follow same steps in adding jquery , bootstrap library.

any appreciated.

the right way include files is:

//= require customejsfile 

in application.js file. what's more, default have

//= require_tree . 

which requires js files assets/javascript path, don't have type on own (and shouldn't, or you'll have file included twice). jquery library included default (and comes jquery gem). if want bootstrap, can way or use 1 of existing gems, bootstrap-generators or twitter-bootstrap-rails.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -