# ApplicationController never fires

**URL:** <https://www.ruby-forum.com/t/applicationcontroller-never-fires/166369>\
**Category:** Rails\
**Created:** [April 24, 2009, 11:00am UTC](https://www.ruby-forum.com/t/applicationcontroller-never-fires/166369 "2009-04-24T11:00:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [April 24, 2009, 11:00am UTC](https://www.ruby-forum.com/t/applicationcontroller-never-fires/166369/1 "2009-04-24T11:00:04Z")

</div>

Hello,

I’m having a very strange problem, it seems that my  
application\_controller.rb never fires.

I create a new rails for testing and I’m having the same problem, but I  
have other rails app that work perfectly, with 2.2.2 and with 2.3.2.

If I change the name of the application\_controller I get the normal  
error message:

uninitialized constant ApplicationController

But in the app that I’m having problems, no matter wich name my  
Application controller has, I never get this error, and the methods  
defined there never fire …

Where I can start digging for this ???

thanks,

r.

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [April 24, 2009, 11:06am UTC](https://www.ruby-forum.com/t/applicationcontroller-never-fires/166369/2 "2009-04-24T11:06:28Z")

</div>

> defined there never fire …

What do you mean by never fire ? Also be aware of the fact that the  
file that rails looks for application\_controller in changed in 2.3.2  
from application.rb to application\_controller.rb

Fred

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [April 24, 2009, 11:15am UTC](https://www.ruby-forum.com/t/applicationcontroller-never-fires/166369/3 "2009-04-24T11:15:33Z")

</div>

Frederick C. wrote:

> > defined there never fire …
> 
> What do you mean by never fire ? Also be aware of the fact that the  
> file that rails looks for application\_controller in changed in 2.3.2  
> from application.rb to application\_controller.rb
> 
> Fred

yes, I know the name has changed, no matter wich name my  
ApplicationController has, or if I completely remove it, I’m not getting  
any warning/error.

The problem is that I’m using some filters around\_filter :user\_type and  
the method user\_type is defined in my application\_controller, but I’m  
getting the undefined method `user\_type’ for  
#DocumentsController:0x25bdfe0

Is there I way to ommit completely the application\_controller ???

thanks …

r.

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [April 24, 2009, 11:40am UTC](https://www.ruby-forum.com/t/applicationcontroller-never-fires/166369/4 "2009-04-24T11:40:57Z")

</div>

After creating a new rails and added some of my code, the problem  
appeared again …

I’m really stupid as I had a controller defined as a \<  
ActionController::Base instead of \< ApplicationController … so I had  
two ApplicationControllers defined but rails didn’t catch this …

sorry and thanks for your help …

regards,

r.

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [April 24, 2009, 11:28am UTC](https://www.ruby-forum.com/t/applicationcontroller-never-fires/166369/5 "2009-04-24T11:28:47Z")

</div>

On Fri, Apr 24, 2009 at 2:15 AM, Raimon Fs  
\<removed\_email\_address@domain.invalid

> wrote:

> yes, I know the name has changed, no matter wich name my  
> thanks …
> 
> ## r.

How are you controller classes (i.e. ApplicationController  
and DocumentsController)  
defined? Is this Rails application upgraded from a previous application  
(i.e. 2.2.2)?  
If this is the case, did you “rake rails:update”?

-Conrad
