I'm using Rails 3.0.9 + Ruby 1.9.2 p180 开发者_JS百科+ Devise, and here's my routes:
[...]
devise_for :users,:controllers => { :sessions => "users/sessions" }
[...]
root :to => "users/sessions#new"
I basically wanted to make the devise login page my root route... But when I try to it my local server (http://localhost:3000), I get the following error:
Unknown action
Could not find devise mapping for path "/". Maybe you forgot to wrap your route inside
the scope block? For example: devise_scope :user do match "/some/route" =>
"some_devise_controller" end
Try this:
devise_scope :user do
root :to => "users/sessions#new"
end
Edit: if you were using devise's default controllers then you would do this:
devise_scope :user do
root :to => "devise/sessions#new"
end
精彩评论