1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #29342 from koic/change_application_js_included_in_rails_app

Change default application.js included in new Rails app [ci skip]
This commit is contained in:
Matthew Draper 2017-06-03 19:03:21 +09:30 committed by GitHub
commit ab4f811d09

View file

@ -447,15 +447,15 @@ For example, a new Rails application includes a default
```js ```js
// ... // ...
//= require jquery //= require rails-ujs
//= require jquery_ujs //= require turbolinks
//= require_tree . //= require_tree .
``` ```
In JavaScript files, Sprockets directives begin with `//=`. In the above case, In JavaScript files, Sprockets directives begin with `//=`. In the above case,
the file is using the `require` and the `require_tree` directives. The `require` the file is using the `require` and the `require_tree` directives. The `require`
directive is used to tell Sprockets the files you wish to require. Here, you are directive is used to tell Sprockets the files you wish to require. Here, you are
requiring the files `jquery.js` and `jquery_ujs.js` that are available somewhere requiring the files `rails-ujs.js` and `turbolinks.js` that are available somewhere
in the search path for Sprockets. You need not supply the extensions explicitly. in the search path for Sprockets. You need not supply the extensions explicitly.
Sprockets assumes you are requiring a `.js` file when done from within a `.js` Sprockets assumes you are requiring a `.js` file when done from within a `.js`
file. file.