Skip to content
This repository
Browse code

Config guide: add further initializers

  • Loading branch information...
commit f0029d0c05d0b92148803ab5dddad16c9f20c500 1 parent 92668f6
Ryan Bigg authored December 05, 2010 fxn committed December 11, 2010
51  railties/guides/source/configuring.textile
Source Rendered
@@ -581,16 +581,63 @@ Adds the directory +app/views+ from the application, railties and engines to the
581 581
 
582 582
 h4. +load_environment_config+
583 583
 
  584
+Loads the +config/environments+ file for the current environment.
584 585
 
  586
+h4. +append_asset_paths+
585 587
 
586  
-h4. Initializer files
  588
+Finds asset paths for the application and all attached railties and keeps a track of the available directories in +config.static_asset_paths+.
587 589
 
588  
-After loading the framework and any gems and plugins in your application, Rails turns to loading initialization code from +config/initializers+. The files in this directory can be used to hold configuration settings that should be made after all of the frameworks and plugins are loaded.
  590
+h4. +prepend_helpers_path+
  591
+
  592
+Adds the directory +app/helpers+ from the application, railties and engines to the lookup path for helpers for the application.
  593
+
  594
+h4. +load_config_initializers+
  595
+
  596
+Loads all files from +config/initializers+ in the application, railties and engines. The files in this directory can be used to hold configuration settings that should be made after all of the frameworks and plugins are loaded.
589 597
 
590 598
 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.
591 599
 
592 600
 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+.
593 601
 
  602
+h4. +engines_blank_point+
  603
+
  604
+Provides a point-in-initialization to hook into if you wish to do anything before engines are loaded. After this point, all railtie and engine initializers are ran.
  605
+
  606
+h4. +add_generator_templates+
  607
+
  608
+Finds templates for generators at +lib/templates+ for the application, railities and engines and adds these to the +config.generators.templates+ setting, which will make the templates available for all generators to reference.
  609
+
  610
+h4. +ensure_autoload_once_paths_as_subset+
  611
+
  612
+Ensures that the +config.autoload_once_paths+ only contains paths from +config.autoload_paths+. If it contains extra paths, then an exception will be raised.
  613
+
  614
+h4. +add_to_prepare_blocks+
  615
+
  616
+The block for every +config.to_prepare+ call in the application, a railtie or engine is added to the +to_prepare+ callbacks for Action Dispatch which will be ran per request in development, or before the first request in production.
  617
+
  618
+h4. +add_builtin_route+
  619
+
  620
+If the application is running under the development environment then this will append the route for +rails/info/properties+ to the application routes. This route provides the detailed information such as Rails and Ruby version for +public/index.html+ in a default Rails application.
  621
+
  622
+h4. +build_middleware_stack+
  623
+
  624
+Builds the middleware stack for the application, returning an object which has a +call+ method which takes a Rack environment object for the request.
  625
+
  626
+h4. +eager_load!+
  627
+
  628
+If +config.cache_classes+ is +true+, runs the +config.before_eager_load+ hooks and then calls +eager_load!+ which will load all the Ruby files from +config.eager_load_paths+.
  629
+
  630
+h4. +finisher_hook+
  631
+
  632
+Provides a hook for after the initialization of process of the application is complete, as well as running all the +config.after_initialize+ blocks for the application, railties and engines.
  633
+
  634
+h4. +set_routes_reloader+
  635
+
  636
+Configures Action Dispatch to reload the routes file using +ActionDispatch::Callbacks.to_prepare+.
  637
+
  638
+h4. +disable_dependency_loading+
  639
+
  640
+
594 641
 h3. Changelog
595 642
 
596 643
 * December 3, 2010: Added initialization events for Rails 3 ("Ryan Bigg":http://ryanbigg.com)

0 notes on commit f0029d0

Please sign in to comment.
Something went wrong with that request. Please try again.