mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Mention that the documentation of create_file can be found on rdoc.info ino the generators guide
This commit is contained in:
parent
3c7a33c051
commit
b640e3f510
1 changed files with 2 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue