I am reading a book for Ruby on Rails. In "application.js" we include other JavaScript libraries as follows and more specific - jQuery UI:
//= require jquery //= require jquery_ujs //= require jquery-ui
How is it a regular JavaScript file (and not ruby extensions here like "html.erb" for exmaple), how does the application know to execute the require command? Which JavaScript syntax is this:
and since this is a regular JavaScript file, why don't we use script tags to include JavaScript files?
In addition, I read here that the “require” method checks this library against $ LOAD_PATH variable folders. How can I see where jquery-ui is stored? I ask, because in other applications to use jQuery UI I have to add not only a JavaScript file, but also a css file and images used by the library - in this case we do this with only one line?
gotqn source share