{"id":922,"date":"2022-08-30T15:09:25","date_gmt":"2022-08-30T15:09:25","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/devise-unknown-action-could-not-find-devise-mapping-for-path-accounts-sign_out-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:09:25","modified_gmt":"2022-08-30T15:09:25","slug":"devise-unknown-action-could-not-find-devise-mapping-for-path-accounts-sign_out-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/devise-unknown-action-could-not-find-devise-mapping-for-path-accounts-sign_out-collection-of-common-programming-errors\/","title":{"rendered":"Devise: Unknown action, Could not find devise mapping for path &ldquo;\/accounts\/sign_out&rdquo;-Collection of common programming errors"},"content":{"rendered":"<p>I keep getting this error every time I point my browser to &#8220;account\/sign_out&#8221; (GET request):<\/p>\n<pre><code>Unknown action, Could not find devise mapping for path \"\/accounts\/sign_out\"\n<\/code><\/pre>\n<p>Here&#8217;s my route for devise:<\/p>\n<pre><code>devise_for :accounts, :controllers =&gt; { :registrations =&gt; :accounts  }\n<\/code><\/pre>\n<p>It must be something trivial, but I don&#8217;t get it. Documentation says devise already provides an action for signing out and binds it to this exact route &#8220;\/accounts\/sign_out&#8221;. Please share with me what am I doing wrong?<\/p>\n<p>The output of <code>rake routes<\/code> shows that the action is mapped:<\/p>\n<pre><code>destroy_account_session GET   \/accounts\/sign_out(.:format)   {:action=&gt;\"destroy\", :controller=&gt;\"devise\/sessions\"}\n<\/code><\/pre>\n<ol>\n<li>\n<p>The problem was that in routes.rb I also had <code>resources :accounts<\/code> route declared before <code>devise_for<\/code>. Therefore, the solution turned out to be to put it after the <code>devise_for<\/code> declaration:<\/p>\n<pre><code>devise_for :accounts, :controllers =&gt; { :registrations =&gt; :accounts  }\nresources :accounts\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:58:33. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I keep getting this error every time I point my browser to &#8220;account\/sign_out&#8221; (GET request): Unknown action, Could not find devise mapping for path &#8220;\/accounts\/sign_out&#8221; Here&#8217;s my route for devise: devise_for :accounts, :controllers =&gt; { :registrations =&gt; :accounts } It must be something trivial, but I don&#8217;t get it. Documentation says devise already provides an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-922","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=922"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/922\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}