aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/generators.md
diff options
context:
space:
mode:
authorEike Send <eike.send@gmail.com>2016-12-17 18:29:55 +0100
committerEileen M. Uchitelle <eileencodes@users.noreply.github.com>2016-12-17 12:29:55 -0500
commit28e49c711e4694d59247c44d7a70510f99be2af3 (patch)
tree72f8d75bb6a77bd1ed08129602c2510dd1359780 /guides/source/generators.md
parente3802f961756aac58d9b4392bf2e73813b09f469 (diff)
downloadrails-28e49c711e4694d59247c44d7a70510f99be2af3.tar.gz
rails-28e49c711e4694d59247c44d7a70510f99be2af3.tar.bz2
rails-28e49c711e4694d59247c44d7a70510f99be2af3.zip
How to disable scaffolds.scss in generators.md (#27383)
* How to disable scaffolds.scss in generators.md * Improves workflow customization text in generators.md
Diffstat (limited to 'guides/source/generators.md')
-rw-r--r--guides/source/generators.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/guides/source/generators.md b/guides/source/generators.md
index 56edfcc8ae..d0b6cef3fd 100644
--- a/guides/source/generators.md
+++ b/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|