blob: d1b33055f29cf1719f53a9b511cc6aa95937bed4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
h2. Asset Pipeline
This guide will cover the ideology of the asset pipeline introduced in Rails 3.1.
By referring to this guide you will be able to:
* Properly organize your application assets
* Understand the benefits of the asset pipline
* Adding a preproccessor to the pipeline
* Package assets with your plugin
endprologue.
h3. What Is The Asset Pipeline?
h4. Why Should I Use it?
Using the asset pipeline allows you to package javascript, CSS, or images with your Rails application, library, or plugin. It also makes it easy to create dynamic CSS with LESS and clean JavaScript with CoffeeScript to name a few of the popular preprocessors. The big difference is that they are now housed in app/assets, treating them like first-class citizens instead of just throughing them into their public folders.
h3. How to Use the Asset Pipeline
h4. Asset Organization
h4. Default Files Loaded
h4. Directives
h4. Stacking Preproccessors
h3. Packaging Assets with Your Plugin
h3. More on Sprockets
Sprockets is the engine that handles the asset pipeline in Rails 3.1 and above. Their offical website is avaialbe at "http://getsprockets.org/":http://getsprockets.org/ and the source code is "on github":https://github.com/sstephenson/sprockets.
|