I am working on a rails 3 project with a rather large route file. It takes advantage of nesting, and I ran into a problem, mainly because route files are difficult to manage.
Is there a way to split it into multiple files?
Sort of:
My::Application.routes.draw do
constraints(:subdomain => 'admin') do
include My::Application::Routes::AdminRoutes
end
include My::Application::Routes::MainRoutes
end
Or...
My::Application.routes.draw do
constraints(:subdomain => 'admin') do
require 'routes/admin_routes.rb'
end
require 'routes/main_routes.rb'
end
Or something like that.
Thank!
source
share