mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
parent
2f9549d4f4
commit
091806388a
1 changed files with 6 additions and 11 deletions
|
@ -22,8 +22,7 @@ The asset pipeline provides a framework to concatenate and minify or compress
|
|||
JavaScript and CSS assets. It also adds the ability to write these assets in
|
||||
other languages and pre-processors such as CoffeeScript, Sass and ERB.
|
||||
It allows assets in your application to be automatically combined with assets
|
||||
from other gems. For example, jquery-rails includes a copy of jquery.js
|
||||
and enables AJAX features in Rails.
|
||||
from other gems.
|
||||
|
||||
The asset pipeline is implemented by the
|
||||
[sprockets-rails](https://github.com/rails/sprockets-rails) gem,
|
||||
|
@ -1205,10 +1204,10 @@ Adding Assets to Your Gems
|
|||
|
||||
Assets can also come from external sources in the form of gems.
|
||||
|
||||
A good example of this is the `jquery-rails` gem which comes with Rails as the
|
||||
standard JavaScript library gem. This gem contains an engine class which
|
||||
inherits from `Rails::Engine`. By doing this, Rails is informed that the
|
||||
directory for this gem may contain assets and the `app/assets`, `lib/assets` and
|
||||
A good example of this is the `jquery-rails` gem.
|
||||
This gem contains an engine class which inherits from `Rails::Engine`.
|
||||
By doing this, Rails is informed that the directory for this
|
||||
gem may contain assets and the `app/assets`, `lib/assets` and
|
||||
`vendor/assets` directories of this engine are added to the search path of
|
||||
Sprockets.
|
||||
|
||||
|
@ -1244,11 +1243,7 @@ moving the files from `public/` to the new locations. See [Asset
|
|||
Organization](#asset-organization) above for guidance on the correct locations
|
||||
for different file types.
|
||||
|
||||
Next will be avoiding duplicate JavaScript files. Since jQuery is the default
|
||||
JavaScript library from Rails 3.1 onwards, you don't need to copy `jquery.js`
|
||||
into `app/assets` and it will be included automatically.
|
||||
|
||||
The third is updating the various environment files with the correct default
|
||||
Next is updating the various environment files with the correct default
|
||||
options.
|
||||
|
||||
In `application.rb`:
|
||||
|
|
Loading…
Reference in a new issue