config.assets.enabled = false
we can also disable the asset pipeline while creating a new application by passing the —skip-sprockets option.
rails new appname –skip-sprockets
Features of asset pipeline:
This feature is important in a production environment, because it can reduce the number of requests that a browser must make to render a web page. Web browsers are limited in the number of requests that they can make in parallel, so fewer requests can mean faster loading for application.
2.Asset minification or compression
With the asset pipeline, the preferred location for these assets is now the app/assets directory. Files in this directory are served by the Sprockets middleware included in the sprockets gem. Assets can still be placed in the public hierarchy. Any assets under public will be served as static files by the application or web server. we should use app/assets for files that must undergo some pre-processing before they are served.
In production, Rails precompiles these files to public/assets by default. The precompiled copies are then served as static assets by the web server. The files in app/assets are never served directly in production.
In Rails 3.1, and Rails 3.2.3 the location of these files differs based on whether they are created by us or come from an external vendor. In this case the files live in the app/assets directory:
In the case of code or images from external vendors, we use the vendor/assets directory:
These are plain js or css files containing directive processors, comment lines followed by a =
//= require jquery
//= require jquery_ujs
//= require_tree .
*= require_tree .
These manifest files reference and include other assets that they depend on. require_directory and require_tree lets we require whole directories and their children, require_self also includes any js or css in the manifest file itself.