aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/generators.textile
diff options
context:
space:
mode:
authorRizwan Reza <rizwanreza@gmail.com>2010-06-05 04:04:49 +0430
committerRizwan Reza <rizwanreza@gmail.com>2010-06-05 04:04:49 +0430
commite6f2102178b19ac8d49363b5fa145f22483c30ee (patch)
treeb5dff24210eb3f521087fe66a9b734165ad22967 /railties/guides/source/generators.textile
parent1535b02a9f8e0eaa3cd3182a45d2bd7855c3809c (diff)
parent8e8cb1769f3a78c53e5b79d0ce6a08589045cfca (diff)
downloadrails-e6f2102178b19ac8d49363b5fa145f22483c30ee.tar.gz
rails-e6f2102178b19ac8d49363b5fa145f22483c30ee.tar.bz2
rails-e6f2102178b19ac8d49363b5fa145f22483c30ee.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'railties/guides/source/generators.textile')
-rw-r--r--railties/guides/source/generators.textile14
1 files changed, 5 insertions, 9 deletions
diff --git a/railties/guides/source/generators.textile b/railties/guides/source/generators.textile
index d3757e9733..704a8793b2 100644
--- a/railties/guides/source/generators.textile
+++ b/railties/guides/source/generators.textile
@@ -20,7 +20,7 @@ h3. First contact
When you create an application using the +rails+ command, you are in fact using a Rails generator. After that, you can get a list of all available generators by just invoking +rails generate+:
<shell>
-$ rails myapp
+$ rails new myapp
$ cd myapp
$ rails generate
</shell>
@@ -322,14 +322,10 @@ config.generators do |g|
g.template_engine :erb
g.test_framework :shoulda, :fixture => false
g.stylesheets false
-end
-</ruby>
-
-And at the end of the same file:
-<ruby>
-require 'rails/generators'
-Rails::Generators.fallbacks[:shoulda] = :test_unit
+ # Add a fallback!
+ g.fallbacks[:should] = :test_unit
+end
</ruby>
Now, if create a Comment scaffold, you will see that shoulda generators are being invoked, and at the end, they are just falling back to test unit generators:
@@ -361,7 +357,7 @@ $ rails generate scaffold Comment body:text
create test/unit/helpers/comments_helper_test.rb
</shell>
-Such tool allows your generators to have single responsibility, increasing the code reuse and reducing the amount of code duplication.
+Such tool allows your generators to have single responsibility, increasing the code reuse and reducing the amount of duplication.
h3. Changelog