From 89884c194af77f5324509db1d14e20f45fc106e0 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Thu, 14 Apr 2011 21:32:18 +0800 Subject: Update scaffold controller to generate scss file if Sass is available --- railties/guides/source/generators.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source/generators.textile') diff --git a/railties/guides/source/generators.textile b/railties/guides/source/generators.textile index d32ba48003..cd8ac3d6fd 100644 --- a/railties/guides/source/generators.textile +++ b/railties/guides/source/generators.textile @@ -190,7 +190,7 @@ $ rails generate scaffold User name:string invoke test_unit create test/unit/helpers/users_helper_test.rb invoke stylesheets - create public/stylesheets/scaffold.css + create app/assets/stylesheets/scaffold.css.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. -- cgit v1.2.3