diff options
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 |