Manifest Files and Directives

suggest change

In the assets initalizer (config/initializers/assets.rb) are a few files explicitly defined to be precompiled.

# Precompile additional assets.
# application.coffee, application.scss, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )

In this example the application.coffee and application.scss are so called ‘Manifest Files’. This files should be used to include other JavaScript or CSS assets. The following command are available:

An application.scss file could look like:

/*
 *= require bootstrap
 *= require_directory .
 *= require_self
 */

Another example is the application.coffee file. Here with including jquery and Turbolinks:

#= require jquery2
#= require jquery_ujs
#= require turbolinks
#= require_tree .

If you don’t use CoffeeScript, but plain JavaScript, the syntax would be:

//= require jquery2
//= require jquery_ujs
//= require turbolinks
//= require_tree .

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Asset pipeline:
*Manifest Files and Directives

Table Of Contents
28Asset pipeline
55CSV