Fix confusing wording in Asset Pipeline guide [ci skip] (#38782)

* Clean up leftover plural "gems" references as a follow-up to
  ab123a33d2
* Remove mention of generating CoffeeScript files in Preprocessing
  section
* Clarify what sass-rails is used for
* Link to the sass-rails repo and sass-lang.com
* Remove mention of the deprecated `sass` gem to reflect the change from
  409d871c2a
This commit is contained in:
rmacklin 2020-03-23 17:36:42 -07:00 committed by GitHub
parent 6a41940a96
commit 0c8206b85e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 14 deletions

View File

@ -33,16 +33,17 @@ passing the `--skip-sprockets` option.
$ rails new appname --skip-sprockets
```
Rails automatically adds the `sass-rails` gem to your `Gemfile`, which is used
by Sprockets for asset compression:
Rails automatically adds the [`sass-rails`](https://github.com/rails/sass-rails)
gem to your `Gemfile`, which is used by Sprockets for
[Sass](https://sass-lang.com) compilation:
```ruby
gem 'sass-rails'
```
Using the `--skip-sprockets` option will prevent Rails from adding
them to your `Gemfile`, so if you later want to enable
the asset pipeline you will have to add those gems to your `Gemfile`. Also,
this gem, so if you later want to enable the asset pipeline
you will have to add it to your `Gemfile` manually. Also,
creating an application with the `--skip-sprockets` option will generate
a slightly different `config/application.rb` file, with a require statement
for the sprockets railtie that is commented-out. You will have to remove
@ -509,17 +510,16 @@ might concatenate three CSS files together this way:
### Preprocessing
The file extensions used on an asset determine what preprocessing is applied.
When a controller or a scaffold is generated with the default Rails gemset, a
CoffeeScript file and a SCSS file are generated in place of a regular JavaScript
and CSS file. The example used before was a controller called "projects", which
generated an `app/assets/stylesheets/projects.scss` file.
When a controller or a scaffold is generated with the default Rails gemset, an
SCSS file is generated in place of a regular CSS file. The example used before
was a controller called "projects", which generated an
`app/assets/stylesheets/projects.scss` file.
In development mode, or if the asset pipeline is disabled, when these files are
requested they are processed by the processors provided by the `coffee-script`
and `sass` gems and then sent back to the browser as JavaScript and CSS
respectively. When asset pipelining is enabled, these files are preprocessed and
placed in the `public/assets` directory for serving by either the Rails app or
web server.
In development mode, or if the asset pipeline is disabled, when this file is
requested it is processed by the processor provided by the `sass-rails` gem and
then sent back to the browser as CSS. When asset pipelining is enabled, this
file is preprocessed and placed in the `public/assets` directory for serving by
either the Rails app or web server.
Additional layers of preprocessing can be requested by adding other extensions,
where each extension is processed in a right-to-left manner. These should be