From aff03e71b4a9d5b0d9190c52ecded79f44e937ce Mon Sep 17 00:00:00 2001 From: Robin Dupret Date: Fri, 26 Dec 2014 17:55:23 +0100 Subject: Update guides regarding the extension changes With rails/coffee-rails#61 (and #17241), the `.coffee` extension is favoured over `.js.coffee`. Respectively, with rails/sass-rails#271 `.scss` and `.sass` are favoured over `.css.scss` and `.css.sass`. Let's update the documentation to reflect that. [ci skip] --- guides/source/generators.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides/source/generators.md') diff --git a/guides/source/generators.md b/guides/source/generators.md index be513dc0ef..05bf07b4c8 100644 --- a/guides/source/generators.md +++ b/guides/source/generators.md @@ -199,11 +199,11 @@ $ bin/rails generate scaffold User name:string create app/views/users/show.json.jbuilder invoke assets invoke coffee - create app/assets/javascripts/users.js.coffee + create app/assets/javascripts/users.coffee invoke scss - create app/assets/stylesheets/users.css.scss + create app/assets/stylesheets/users.scss invoke scss - create app/assets/stylesheets/scaffolds.css.scss + create app/assets/stylesheets/scaffolds.scss ``` 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. @@ -409,7 +409,7 @@ $ bin/rails generate scaffold Comment body:text create app/views/comments/show.json.jbuilder invoke assets invoke coffee - create app/assets/javascripts/comments.js.coffee + create app/assets/javascripts/comments.coffee invoke scss ``` -- cgit v1.2.3