Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Re-add "Using initializer files" section to configuring guide

  • Loading branch information...
commit 27717655ad7ab4549a5799285975e425e8f80b15 1 parent 75bfb47
@radar radar authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 railties/guides/source/configuring.textile
View
9 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):
Please sign in to comment.
Something went wrong with that request. Please try again.