aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-11-26 18:06:14 +1100
committerRyan Bigg <radarlistener@gmail.com>2010-11-26 18:06:14 +1100
commit8d6ac59d58ff7fce851a894d714e0677c11d7eb6 (patch)
tree989584089abcf55fa719b4fe1749d1d849f8c80a /railties
parent72e973ebbcddbeb172c2dd3a7ddc12957dc5bec0 (diff)
downloadrails-8d6ac59d58ff7fce851a894d714e0677c11d7eb6.tar.gz
rails-8d6ac59d58ff7fce851a894d714e0677c11d7eb6.tar.bz2
rails-8d6ac59d58ff7fce851a894d714e0677c11d7eb6.zip
Added documentation for config.generators to the config guide
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/configuring.textile27
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile
index 154eebc0c1..c395e42c00 100644
--- a/railties/guides/source/configuring.textile
+++ b/railties/guides/source/configuring.textile
@@ -47,6 +47,8 @@ h4. Rails General Configuration
end
</ruby>
+* +config.app_generators+ alternate name for +config.generators+. See the "Configuring Generators" section below for how to use this.
+
* +config.autoload_once_paths+ accepts an array of paths from which Rails will automatically load from only once. All elements of this array must also be in +autoload_paths+.
* +config.autoload_paths+ accepts an array of additional paths to prepend to the load path. By default, all app, lib, vendor and mock paths are included in this list.
@@ -79,6 +81,31 @@ h4. Rails General Configuration
* +config.whiny_nils+ enables or disabled warnings when an methods of nil are invoked. Defaults to _false_.
+h4. Configuring Generators
+
+Rails 3 allows you to alter what generators are used with the +config.generators+ method. This method takes a block:
+
+<ruby>
+ config.generators do |g|
+ g.orm :active_record
+ g.test_framework :test_unit
+ end
+</ruby>
+
+The full set of methods that can be used in this block are as follows:
+
+* +force_plural+ allows pluralized model names. Defaults to _false_.
+* +helper+ defines whether or not to generate helpers. Defaults to _true_
+* +orm+ defines which orm to use. Defaults to _nil_, so will use Active Record by default.
+* +integration_tool+ defines which integration tool to use. Defaults to _nil_
+* +performance_tool+ defines which performance tool to use. Defaults to _nil_
+* +resource_controller+ defines which generator to use for generating a controller when using +rails generate resource+. Defaults to +:controller+.
+* +scaffold_controller+ different from +resource_controller+, defines which generator to use for generating a _scaffolded_ controller when using +rails generate scaffold+. Defaults to +:scaffold_controller+
+* +stylesheets+ turns on the hook for stylesheets in generators. Used in Rails for when the +scaffold+ generator is ran, but this hook can be used in other generates as well.
+* +test_framework+ defines which test framework to use. Defaults to _nil_, so will use Test::Unit by default.
+* +template_engine+ defines which template engine to use, such as ERB or Haml. Defaults to +:erb+.
+
+
h4. Configuring i18n
* +config.i18n.default_locale+ sets the default locale of an application used for i18n. Defaults to +:en+.