views:

69

answers:

1

Hi people!

I am building an administration space in my web application. To do this, I am using namespaces but even if the rake generated routes are ok, when i follow the root of my admin space I get an error:

Routing Error
No route matches "/guru"

My routes.rb :

Baies::Application.routes.draw do |map|
  resources :fights
  resources :actions
  resources :users

  namespace :guru do
    root :to => "guru#index"
    resources :users
  end

  root :to => "public#index"
end

My arbo:

.
`-- app
   `-- controllers
      |-- actions_controller.rb
      |-- application_controller.rb
      |-- fights_controller.rb
      |-- guru
      |   |-- guru_controller.rb
      |   `-- users_controller.rb
      |-- public_controller.rb
      `-- users_controller.rb

For information, the routes /guru/users works :)

Thanks for help!

@tchaOo°

A: 

It's OK. I was doing like with Rails 2. With Rails 3, we have to specify the namespace of the controller:

  namespace :guru do
    root :to => "Guru::Guru#index"
    resources :users
  end

@tchaOo°

Plume