Ckt22
Ckt22

Reputation: 191

Namespace setting of RoR route

If I set the following content in the route, will the two "projects" be the same? (Such as Controller and View)

Rails.application.routes.draw do
  resources :projects

  namespace :admin do
    resources :projects
  end

end

Upvotes: 0

Views: 53

Answers (1)

Parvesh Vats
Parvesh Vats

Reputation: 46

No the two "projects" will not be same. For first one controller and views will be in the main folder and for 2nd one the controller and view will lie under the admin folder in directory. Also, the routes for first one will be like -- for index -- /projects and for 2nd one for index -- /admin/projects

Upvotes: 1

Related Questions