Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Mar 24, 2020
30 changes: 15 additions & 15 deletions guides/source/asset_pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

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.
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 this file is
requested it is processed by the processor provided by the `sass` gem and then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sass gem is no longer maintained, and sass-rails now depends on the sassc gem instead via sassc-rails (#32896).

Even if it's not technically accurate, I think this should say "provided by the sass-rails gem" - for the purposes of following this guide, it's enough to know that the processor is available because sass-rails is in the Gemfile, even if the code is ultimately provided by a different gem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Updated to sass-rails in 649d265

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
Expand Down