diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:26:31 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:26:31 -0500 |
commit | 926f4648f0628009336c44f4d31019819434e39c (patch) | |
tree | 41832ea22ba2c567cca2cad41db1cb966be090ae /railties/lib | |
parent | e931394d098714c6a4cbb91b8c8c00bd9d6fb850 (diff) | |
download | rails-926f4648f0628009336c44f4d31019819434e39c.tar.gz rails-926f4648f0628009336c44f4d31019819434e39c.tar.bz2 rails-926f4648f0628009336c44f4d31019819434e39c.zip |
Made the location of the routes file configurable with config.routes_configuration_file (Scott Fleckenstein) [#88 state:resolved]
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 09a98d5aa3..5fd7149858 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -386,6 +386,7 @@ module Rails def initialize_routing return unless configuration.frameworks.include?(:action_controller) ActionController::Routing.controller_paths = configuration.controller_paths + ActionController::Routing::Routes.configuration_file = configuration.routes_configuration_file ActionController::Routing::Routes.reload end @@ -503,6 +504,10 @@ module Rails # The path to the database configuration file to use. (Defaults to # <tt>config/database.yml</tt>.) attr_accessor :database_configuration_file + + # The path to the routes configuration file to use. (Defaults to + # <tt>config/routes.rb</tt>.) + attr_accessor :routes_configuration_file # The list of rails framework components that should be loaded. (Defaults # to <tt>:active_record</tt>, <tt>:action_controller</tt>, @@ -635,6 +640,7 @@ module Rails self.plugin_locators = default_plugin_locators self.plugin_loader = default_plugin_loader self.database_configuration_file = default_database_configuration_file + self.routes_configuration_file = default_routes_configuration_file self.gems = default_gems for framework in default_frameworks @@ -775,6 +781,10 @@ module Rails File.join(root_path, 'config', 'database.yml') end + def default_routes_configuration_file + File.join(root_path, 'config', 'routes.rb') + end + def default_view_path File.join(root_path, 'app', 'views') end |