Home > Mobile >  Namespace setting of RoR route
Namespace setting of RoR route

Time:12-22

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

CodePudding user response:

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

  • Related