# Helper methods not availlable in controller

**URL:** <https://www.ruby-forum.com/t/helper-methods-not-availlable-in-controller/148577>\
**Category:** Rails\
**Created:** [September 15, 2008, 9:38am UTC](https://www.ruby-forum.com/t/helper-methods-not-availlable-in-controller/148577 "2008-09-15T09:38:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wijnand\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a9adbd/32.png) [@Wijnand\_W](https://www.ruby-forum.com/u/Wijnand_W)\
**Post date:** [September 15, 2008, 9:38am UTC](https://www.ruby-forum.com/t/helper-methods-not-availlable-in-controller/148577/1 "2008-09-15T09:38:21Z")

</div>

Hi,

I don’t start pasting lots of code since I am not sure what would be  
relevant.

I have one controller that doesn’t include all my helper methods.  
I get: undefined method `full\_admin?’ for #\<CompaniesController:  
0x20ce458\>  
full\_admin? is defined in my users\_helper  
def full\_admin?  
current\_user.full\_admin?  
end

I do have  
helper :all # include all helpers, all the time  
in my application.rb controller.

So I would expect it to be availlable in all my controllers.

I know a helper method might not be the proper place for this but I  
liked the syntactic suger for my controllers and views 😉

What am I doing wrong?

Regards,  
Wijnand

---

<div class="post-metadata">

**Author:** ![Wijnand\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a9adbd/32.png) [@Wijnand\_W](https://www.ruby-forum.com/u/Wijnand_W)\
**Post date:** [September 15, 2008, 9:43am UTC](https://www.ruby-forum.com/t/helper-methods-not-availlable-in-controller/148577/2 "2008-09-15T09:43:04Z")

</div>

On Sep 14, 11:55 pm, Wijnand W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> So I would expect it to be availlable in all my controllers.
> 
> I know a helper method might not be the proper place for this but I  
> liked the syntactic suger for my controllers and views 😉

Helper means view helper: they are only included in views. If you want  
a method you can call from views or controllers you need to define it  
in your controller (if you need all controllers to see it then in  
ApplicationController) and use helper\_method to make it accessible to  
views.

Fred

---

<div class="post-metadata">

**Author:** ![Wijnand\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a9adbd/32.png) [@Wijnand\_W](https://www.ruby-forum.com/u/Wijnand_W)\
**Post date:** [December 27, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/helper-methods-not-availlable-in-controller/148577/3 "2008-12-27T15:22:24Z")

</div>

> Helper means view helper: they are only included in views. If you want  
> a method you can call from views or controllers you need to define it  
> in your controller (if you need all controllers to see it then in  
> ApplicationController) and use helper\_method to make it accessible to  
> views.
> 
> Fred

Okay, so how would you allow a controller (or even a model) to use for  
instance the helpers truncate or sanitize?

---

<div class="post-metadata">

**Author:** ![Wijnand\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a9adbd/32.png) [@Wijnand\_W](https://www.ruby-forum.com/u/Wijnand_W)\
**Post date:** [December 27, 2008, 3:52pm UTC](https://www.ruby-forum.com/t/helper-methods-not-availlable-in-controller/148577/4 "2008-12-27T15:52:58Z")

</div>

> Okay, so how would you allow a controller (or even a model) to use for  
> instance the helpers truncate or sanitize?

The solution I have found was to use xss\_terminate plugin (compatible  
with Rails 2.2.2), it also allows to dive into its code and see how it  
is coded.
