plataformatec/devise — Issue #1424: Could not find devise mapping for path "/login"
Author: keekun
Created: 2011-11-07 17:34:10+00:00
State: open

I followed the code here https://github.com/plataformatec/devise/wiki/How-To:-Change-the-default-sign_in-and-sign_out-routes and read the readme, but still got this error.

````ruby
# ERROR
AbstractController::ActionNotFound (Could not find devise mapping for path "/login".
Maybe you forgot to wrap your route inside the scope block? For example:
devise_scope :user do
match "/some/route" => "some_devise_controller"
end
):

# MY ROUTES SETTINGS

MyProject::Application.routes.draw do
devise_scope :member do
get "/login" => "devise/sessions#new"
end

mount Rich::Engine => '/rich'

ActiveAdmin.routes(self)

devise_for :admin_users, ActiveAdmin::Devise.config

end

# MY RAKE ROUTES (before I set mapping)
new_member_session GET /members/sign_in(.:format) {:controller=>"devise/sessions", :action=>"new"}
member_session POST /members/sign_in(.:format) {:controller=>"devise/sessions", :action=>"create"}
destroy_member_session DELETE /members/sign_out(.:format) {:controller=>"devise/sessions", :action=>"destroy"}
member_password POST /members/password(.:format) {:controller=>"devise/passwords", :action=>"create"}
new_member_password GET /members/password/new(.:format) {:controller=>"devise/passwords", :action=>"new"}
edit_member_password GET /members/password/edit(.:format) {:controller=>"devise/passwords", :action=>"edit"}
PUT /members/password(.:format) {:controller=>"devise/passwords", :action=>"update"}
cancel_member_registration GET /members/cancel(.:format) {:controller=>"devise/registrations", :action=>"cancel"}
member_registration POST /members(.:format) {:controller=>"devise/registrations", :action=>"create"}
new_member_registration GET /members/sign_up(.:format) {:controller=>"devise/registrations", :action=>"new"}
edit_member_registration GET /members/edit(.:format) {:controller=>"devise/registrations", :action=>"edit"}
PUT /members(.:format) {:controller=>"devise/registrations", :action=>"update"}
DELETE /members(.:format) {:controller=>"devise/registrations", :action=>"destroy"}
rich /rich {:to=>Rich::Engine}
admin_api_get_stations GET /admin_api/get_stations(.:format) {:controller=>"admin_api", :action=>"get_stations"}
admin_dashboard /admin(.:format) {:controller=>"admin/dashboard", :action=>"index"}
admin_comments GET /admin/comments(.:format) {:controller=>"admin/comments", :action=>"index"}
POST /admin/comments(.:format) {:controller=>"admin/comments", :action=>"create"}
new_admin_comment GET /admin/comments/new(.:format) {:controller=>"admin/comments", :action=>"new"}
edit_admin_comment GET /admin/comments/:id/edit(.:format) {:controller=>"admin/comments", :action=>"edit"}
admin_comment GET /admin/comments/:id(.:format) {:controller=>"admin/comments", :action=>"show"}
PUT /admin/comments/:id(.:format) {:controller=>"admin/comments", :action=>"update"}
DELETE /admin/comments/:id(.:format) {:controller=>"admin/comments", :action=>"destroy"}
admin_pages GET /admin/pages(.:format) {:controller=>"admin/pages", :action=>"index"}
POST /admin/pages(.:format) {:controller=>"admin/pages", :action=>"create"}
new_admin_page GET /admin/pages/new(.:format) {:controller=>"admin/pages", :action=>"new"}
edit_admin_page GET /admin/pages/:id/edit(.:format) {:controller=>"admin/pages", :action=>"edit"}
admin_page GET /admin/pages/:id(.:format) {:controller=>"admin/pages", :action=>"show"}
PUT /admin/pages/:id(.:format) {:controller=>"admin/pages", :action=>"update"}
DELETE /admin/pages/:id(.:format) {:controller=>"admin/pages", :action=>"destroy"}
admin_members GET /admin/members(.:format) {:controller=>"admin/members", :action=>"index"}
POST /admin/members(.:format) {:controller=>"admin/members", :action=>"create"}
new_admin_member GET /admin/members/new(.:format) {:controller=>"admin/members", :action=>"new"}
edit_admin_member GET /admin/members/:id/edit(.:format) {:controller=>"admin/members", :action=>"edit"}
admin_member GET /admin/members/:id(.:format) {:controller=>"admin/members", :action=>"show"}
PUT /admin/members/:id(.:format) {:controller=>"admin/members", :action=>"update"}
DELETE /admin/members/:id(.:format) {:controller=>"admin/members", :action=>"destroy"}
admin_admin_users GET /admin/admin_users(.:format) {:controller=>"admin/admin_users", :action=>"index"}
POST /admin/admin_users(.:format) {:controller=>"admin/admin_users", :action=>"create"}
new_admin_admin_user GET /admin/admin_users/new(.:format) {:controller=>"admin/admin_users", :action=>"new"}
edit_admin_admin_user GET /admin/admin_users/:id/edit(.:format) {:controller=>"admin/admin_users", :action=>"edit"}
admin_admin_user GET /admin/admin_users/:id(.:format) {:controller=>"admin/admin_users", :action=>"show"}
PUT /admin/admin_users/:id(.:format) {:controller=>"admin/admin_users", :action=>"update"}
DELETE /admin/admin_users/:id(.:format) {:controller=>"admin/admin_users", :action=>"destroy"}
admin_jobs GET /admin/jobs(.:format) {:controller=>"admin/jobs", :action=>"index"}
POST /admin/jobs(.:format) {:controller=>"admin/jobs", :action=>"create"}
new_admin_job GET /admin/jobs/new(.:format) {:controller=>"admin/jobs", :action=>"new"}
edit_admin_job GET /admin/jobs/:id/edit(.:format) {:controller=>"admin/jobs", :action=>"edit"}
admin_job GET /admin/jobs/:id(.:format) {:controller=>"admin/jobs", :action=>"show"}
PUT /admin/jobs/:id(.:format) {:controller=>"admin/jobs", :action=>"update"}
DELETE /admin/jobs/:id(.:format) {:controller=>"admin/jobs", :action=>"destroy"}
new_admin_user_session GET /admin/login(.:format) {:controller=>"active_admin/devise/sessions", :action=>"new"}
admin_user_session POST /admin/login(.:format) {:controller=>"active_admin/devise/sessions", :action=>"create"}
destroy_admin_user_session DELETE|GET /admin/logout(.:format) {:controller=>"active_admin/devise/sessions", :action=>"destroy"}
admin_user_password POST /admin/password(.:format) {:controller=>"active_admin/devise/passwords", :action=>"create"}
new_admin_user_password GET /admin/password/new(.:format) {:controller=>"active_admin/devise/passwords", :action=>"new"}
edit_admin_user_password GET /admin/password/edit(.:format) {:controller=>"active_admin/devise/passwords", :action=>"edit"}
PUT /admin/password(.:format) {:controller=>"active_admin/devise/passwords", :action=>"update"}
root / {:controller=>"welcome", :action=>"index"}

# AFTER I set mapping
login GET /login(.:format) {:controller=>"devise/sessions", :action=>"new"}
rich /rich {:to=>Rich::Engine}
admin_api_get_stations GET /admin_api/get_stations(.:format) {:controller=>"admin_api", :action=>"get_stations"}
admin_dashboard /admin(.:format) {:controller=>"admin/dashboard", :action=>"index"}
admin_comments GET /admin/comments(.:format) {:controller=>"admin/comments", :action=>"index"}
POST /admin/comments(.:format) {:controller=>"admin/comments", :action=>"create"}
.
.
.
````

Thank you.