# Cant find method in application\_helper from layout

**URL:** <https://www.ruby-forum.com/t/cant-find-method-in-application-helper-from-layout/173214>\
**Category:** Rails\
**Created:** [August 5, 2009, 1:44am UTC](https://www.ruby-forum.com/t/cant-find-method-in-application-helper-from-layout/173214 "2009-08-05T01:44:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [August 5, 2009, 1:44am UTC](https://www.ruby-forum.com/t/cant-find-method-in-application-helper-from-layout/173214/1 "2009-08-05T01:44:02Z")

</div>

I am having some trouble with an old app I need to work on…

I have managed to get it mostly working with Rails 2.3,  
but I have run into this problem:

undefined method `class\_current\_controller?’ for  
#ActionView::Base:0x224c6a4

class\_current\_controller? is defined in application\_helper.rb

it should be finding it no?  
not sure what is going on here…

I tried writing a test method and calling that from the layout just to  
make sure and I get the same problem.

any help much appreciated!

thanks  
adam

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [August 5, 2009, 6:25am UTC](https://www.ruby-forum.com/t/cant-find-method-in-application-helper-from-layout/173214/2 "2009-08-05T06:25:01Z")

</div>

Quoting A. Wilson [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> it should be finding it no?  
> not sure what is going on here…
> 
> I tried writing a test method and calling that from the layout just to  
> make sure and I get the same problem.

Is class\_current\_controller? a instance or a class method?

Jeffrey

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [August 5, 2009, 9:38am UTC](https://www.ruby-forum.com/t/cant-find-method-in-application-helper-from-layout/173214/3 "2009-08-05T09:38:46Z")

</div>

Its just a normal method defined in application\_helper… I assume its  
an instance method of the helper, it is not defined as ‘def  
self.method’  
Its defined as: ‘def class\_current\_controller?’

Thanks

---

<div class="post-metadata">

**Author:** ![hirodusk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Post date:** [August 5, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/cant-find-method-in-application-helper-from-layout/173214/4 "2009-08-05T21:46:18Z")

</div>

adamski wrote:

> Its just a normal method defined in application\_helper… I assume its  
> an instance method of the helper, it is not defined as ‘def  
> self.method’  
> Its defined as: ‘def class\_current\_controller?’
> 
> Thanks

Ok the problem was, I am using comatose, and the comatose\_admin layout  
did not have access to application\_helper - solutions was simply to add  
“helper ‘application’” to comatose\_admin\_controller.rb

Perhaps there has been a change in rails that means that  
application\_helper is not available to plugins without declaration?
