aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/configuring.textile
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2011-01-03 12:00:14 +1000
committerRyan Bigg <radarlistener@gmail.com>2011-01-06 20:10:00 +1000
commit27717655ad7ab4549a5799285975e425e8f80b15 (patch)
tree854a8537a6ed71a61dc7ce963a81761d2570e1d2 /railties/guides/source/configuring.textile
parent75bfb4761c21a8f97f6c1780855f811adcc4c1c8 (diff)
downloadrails-27717655ad7ab4549a5799285975e425e8f80b15.tar.gz
rails-27717655ad7ab4549a5799285975e425e8f80b15.tar.bz2
rails-27717655ad7ab4549a5799285975e425e8f80b15.zip
Re-add "Using initializer files" section to configuring guide
Diffstat (limited to 'railties/guides/source/configuring.textile')
-rw-r--r--railties/guides/source/configuring.textile9
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile
index 6e72ae6ead..a3da5e93f1 100644
--- a/railties/guides/source/configuring.textile
+++ b/railties/guides/source/configuring.textile
@@ -397,6 +397,15 @@ Some parts of Rails can also be configured externally by supplying environment v
* +ENV["RAILS_CACHE_ID"]+ and +ENV["RAILS_APP_VERSION"]+ are used to generate expanded cache keys in Rails' caching code. This allows you to have multiple separate caches from the same application.
+
+h3. Using Initializer Files
+
+After loading the framework and any gems and plugins in your application, Rails turns to loading initializers. An initializer is any file of Ruby code stored under +config/initializers+ in your application. You can use initializers to hold configuration settings that should be made after all of the frameworks, plugins and gems are loaded, such as options to configure settings for these parts.
+
+NOTE: You can use subfolders to organize your initializers if you like, because Rails will look into the whole file hierarchy from the initializers folder on down.
+
+TIP: If you have any ordering dependency in your initializers, you can control the load order by naming. For example, +01_critical.rb+ will be loaded before +02_normal.rb+.
+
h3. Initialization events
Rails has 5 initialization events which can be hooked into (listed in order that they are ran):