views:

51

answers:

1

I'm trying to define a route in routes.rb and I can't do anything from this Ruby on Rails routing guide that will let this error pass.

No route matches {:controller=>"devise/home"}

Here's my routes.rb source.

SchoolCMS::Application.routes.draw do
  root :to => "home#index"

  devise_for :teachers, :admin

  resources :home, :only => :index
  resources :admin, :only => :index

  resources :events do
    resources :event
  end

  resources :posts do
    resources :comments
  end  

end
+1  A: 

Just to be safe I would remove devise_for :teachers, :admin and split it so that it is

devise_for :teachers
devise_for :admin

I'm not sure you can specify multiple devises the way you use it, see if this fixes your error.

Also try to use path helpers were possible so instead of doing <%= link_to 'Home', :controller => 'home' %> make it <%= link_to 'Home', homes_path %> but make sure you define your home as resource :home, :only => :show since it's a singular resource.

Maran
It's undocumented, but [the source code](http://github.com/plataformatec/devise/blob/master/lib/devise/rails/routes.rb#L136) seems to indicate that one can. Even so, I'd try making this change to see if anything happens :)
Matchu