{"id":567,"date":"2022-08-30T15:03:30","date_gmt":"2022-08-30T15:03:30","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/devise-undefined-method-user_signed_in-for-applicationcontrollerclass-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:03:30","modified_gmt":"2022-08-30T15:03:30","slug":"devise-undefined-method-user_signed_in-for-applicationcontrollerclass-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/devise-undefined-method-user_signed_in-for-applicationcontrollerclass-collection-of-common-programming-errors\/","title":{"rendered":"Devise: undefined method `user_signed_in?&#39; for ApplicationController:Class-Collection of common programming errors"},"content":{"rendered":"<p>So I&#8217;m marking this as a community wiki since the solution is trivial.<\/p>\n<p>I was calling debugger (which I used to check <code>current_user<\/code> with the following code<\/p>\n<pre><code>class ApplicationController &lt; ActionController::Base\n  protect_from_forgery\n  debugger\n  filter {|c| Authorization.current_user = c.current_user}\nend\n<\/code><\/pre>\n<p>Rails makes the session and request objects available to instances of controllers. That debugger is called in the context of <code>self == ApplicationController<\/code> when it should be <code>self == #<\/code>.<\/p>\n<p>Long story short, make sure you&#8217;re not trying to call it within a controller <em>definition<\/em> but within the controller <em>instance<\/em>.<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 20:53:41. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>So I&#8217;m marking this as a community wiki since the solution is trivial. I was calling debugger (which I used to check current_user with the following code class ApplicationController &lt; ActionController::Base protect_from_forgery debugger filter {|c| Authorization.current_user = c.current_user} end Rails makes the session and request objects available to instances of controllers. That debugger is called [&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-567","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/567","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=567"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/567\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}