{"id":718,"date":"2022-08-30T15:06:01","date_gmt":"2022-08-30T15:06:01","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/rails-3-0-9-ruby-1-9-2-p180-devise-routes-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:06:01","modified_gmt":"2022-08-30T15:06:01","slug":"rails-3-0-9-ruby-1-9-2-p180-devise-routes-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/rails-3-0-9-ruby-1-9-2-p180-devise-routes-collection-of-common-programming-errors\/","title":{"rendered":"Rails 3.0.9 + Ruby 1.9.2 p180 + Devise &#8211; Routes-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m using Rails 3.0.9 + Ruby 1.9.2 p180 + Devise, and here&#8217;s my routes:<\/p>\n<pre><code>[...]\ndevise_for :users,:controllers =&gt; { :sessions =&gt; \"users\/sessions\" }\n[...]\nroot :to =&gt; \"users\/sessions#new\"\n<\/code><\/pre>\n<p>I basically wanted to make the devise login page my root route&#8230; But when I try to it my local server (http:\/\/localhost:3000), I get the following error:<\/p>\n<pre><code>Unknown action\n\nCould not find devise mapping for path \"\/\". Maybe you forgot to wrap your route inside\nthe scope block? For example: devise_scope :user do match \"\/some\/route\" =&gt; \n\"some_devise_controller\" end\n<\/code><\/pre>\n<ol>\n<li>\n<p>Try this:<\/p>\n<pre><code>devise_scope :user do \n  root :to =&gt; \"users\/sessions#new\"\nend\n<\/code><\/pre>\n<p><strong>Edit:<\/strong> if you were using devise&#8217;s default controllers then you would do this:<\/p>\n<pre><code>devise_scope :user do \n  root :to =&gt; \"devise\/sessions#new\"\nend\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:43:24. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using Rails 3.0.9 + Ruby 1.9.2 p180 + Devise, and here&#8217;s my routes: [&#8230;] devise_for :users,:controllers =&gt; { :sessions =&gt; &#8220;users\/sessions&#8221; } [&#8230;] root :to =&gt; &#8220;users\/sessions#new&#8221; I basically wanted to make the devise login page my root route&#8230; But when I try to it my local server (http:\/\/localhost:3000), I get the following error: [&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-718","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/718","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=718"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/718\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}