aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-12-01 13:48:33 +1100
committerRyan Bigg <radarlistener@gmail.com>2010-12-01 15:23:27 +1100
commitb640e3f5107b68e62967cba20e5f627170d98460 (patch)
tree0f2be125cc03bba8269d612c4490ec03488ea194 /railties/guides
parent3c7a33c0510e30a3017b007d8ed8afcae02ef4a6 (diff)
downloadrails-b640e3f5107b68e62967cba20e5f627170d98460.tar.gz
rails-b640e3f5107b68e62967cba20e5f627170d98460.tar.bz2
rails-b640e3f5107b68e62967cba20e5f627170d98460.zip
Mention that the documentation of create_file can be found on rdoc.info ino the generators guide
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/generators.textile2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/guides/source/generators.textile b/railties/guides/source/generators.textile
index 99c34ed30f..909c79f3cb 100644
--- a/railties/guides/source/generators.textile
+++ b/railties/guides/source/generators.textile
@@ -45,6 +45,8 @@ class InitializerGenerator < Rails::Generators::Base
end
</ruby>
+NOTE: +create_file+ is a method provided by +Thor::Actions+ and the documentation for it and its brethren can be found at "rdoc.info":http://rdoc.info/github/wycats/thor/master/Thor/Actions.
+
Our new generator is quite simple: it inherits from +Rails::Generators::Base+ and has one method definition. Each public method in the generator is executed when a generator is invoked. Finally, we invoke the +create_file+ method that will create a file at the given destination with the given content. If you are familiar with the Rails Application Templates API, you'll feel right at home with the new generators API.
To invoke our new generator, we just need to do: