orion3
orion3

Reputation: 9935

Devise: Unknown action, Could not find devise mapping for path "/accounts/sign_out"

I keep getting this error every time I point my browser to "account/sign_out" (GET request):

Unknown action, Could not find devise mapping for path "/accounts/sign_out"

Here's my route for devise:

devise_for :accounts, :controllers => { :registrations => :accounts  }

It must be something trivial, but I don't get it. Documentation says devise already provides an action for signing out and binds it to this exact route "/accounts/sign_out". Please share with me what am I doing wrong?

The output of rake routes shows that the action is mapped:

destroy_account_session GET   /accounts/sign_out(.:format)   {:action=>"destroy", :controller=>"devise/sessions"}

Upvotes: 2

Views: 4052

Answers (1)

orion3
orion3

Reputation: 9935

The problem was that in routes.rb I also had resources :accounts route declared before devise_for. Therefore, the solution turned out to be to put it after the devise_for declaration:

devise_for :accounts, :controllers => { :registrations => :accounts  }
resources :accounts

Upvotes: 1

Related Questions