Permalink
Browse files

How to disable scaffolds.scss in generators.md (#27383)

* How to disable scaffolds.scss in generators.md

* Improves workflow customization text in generators.md
  • Loading branch information...
eikes authored and eileencodes committed Dec 17, 2016
1 parent e3802f9 commit 28e49c711e4694d59247c44d7a70510f99be2af3
Showing with 9 additions and 1 deletion.
  1. +9 −1 guides/source/generators.md
@@ -208,7 +208,15 @@ $ bin/rails generate scaffold User name:string
Looking at this output, it's easy to understand how generators work in Rails 3.0 and above. The scaffold generator doesn't actually generate anything, it just invokes others to do the work. This allows us to add/replace/remove any of those invocations. For instance, the scaffold generator invokes the scaffold_controller generator, which invokes erb, test_unit and helper generators. Since each generator has a single responsibility, they are easy to reuse, avoiding code duplication.
Our first customization on the workflow will be to stop generating stylesheet, JavaScript and test fixture files for scaffolds. We can achieve that by changing our configuration to the following:
If we want to avoid generating the default `app/assets/stylesheets/scaffolds.scss` file when scaffolding a new resource we can disable `scaffold_stylesheet`:
```ruby
config.generators do |g|
g.scaffold_stylesheet false
end
```
The next customization on the workflow will be to stop generating stylesheet, JavaScript and test fixture files for scaffolds altogether. We can achieve that by changing our configuration to the following:
```ruby
config.generators do |g|

0 comments on commit 28e49c7

Please sign in to comment.