-1

I'm getting an error No route matches [GET] because trying to create folders per certain controllers

Here the app structure:

|controller,helper,view|
 |user_management| ------> FOLDER
   |user|          ------> SUBFOLDER  
   |login|         ------> SUBFOLDER    
   |chat|          ------> SUBFOLDER  
 |sale_management| ------> FOLDER  
   |sale|          ------> SUBFOLDER  
   |product|       ------> SUBFOLDER  

Here controllers:

 # UserManagement Controllers
 class UserManagement::UserController < ApplicationController
 class UserManagement::LoginController < ApplicationController
 class UserManagement::ChatController < ApplicationController

 # SaleManagement Controllers
 class SaleManagement::SaleController < ApplicationController
 class SaleManagement::ProductController < ApplicationController

Here helpers:

 module UserManagement::UserHelper
 module UserManagement::LoginHelper
 module UserManagement::ChatHelper
 module SaleManagement::SaleHelper
 module SaleManagement::ProductHelper

Router.rb from rails 2.3 and ruby 1.8

map.root :controller => "user_management/user", :action=>"index"
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'

I'm doing Routes.rb from rails 3 and ruby 1.9 but got ROUTES ERROR

root :to => 'user_management/user#index'
match ':controller(/:action(/:id))(.:format)'

Please somebody can help me?

Carlos Morales
  • 1,137
  • 3
  • 15
  • 38

1 Answers1

2

Here is example

scope module: 'user_management' do
   scope module: 'user' do
      resources :users
   end
end

Then you can access users like localhost:3000/users

For more detail Check Rails Routing

Sajjad Murtaza
  • 1,444
  • 2
  • 16
  • 26