views:

61

answers:

2

I have an intranet application with several modules, I want them to separate when routing. For example:

 http://intranet/calendar/...
 http://intranet/site_admin/...
 http://intranet/tasks/...

Each of module can have many or single controller. How to write such routes?

+2  A: 

You can try using namespaces:

map.namespace :calendar do |calendar|
  calendar.resources :first_controller
  calendar.resources :second_controller
end

And so on. Very often people put admin part of application in admin namespace (look here). Try google "rails namespace".

klew
A: 

Also if you may want to upgrade to the latest version i.e Rails 2.3. And build those modules as separate 'Engines'. http://railscasts.com/episodes/149-rails-engines

Dipesh Batheja