totocaster
totocaster

Reputation: 6363

Module name scopes in routing

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?

Upvotes: 0

Views: 207

Answers (2)

Dipesh Batheja
Dipesh Batheja

Reputation:

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

Upvotes: 0

klew
klew

Reputation: 14977

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".

Upvotes: 2

Related Questions