# HELPERS\_DIR is missing

**URL:** <https://www.ruby-forum.com/t/helpers-dir-is-missing/152205>\
**Category:** Rails\
**Created:** [October 31, 2008, 9:00am UTC](https://www.ruby-forum.com/t/helpers-dir-is-missing/152205 "2008-10-31T09:00:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![boblu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b19c9b/32.png) [@boblu](https://www.ruby-forum.com/u/boblu)\
**Post date:** [October 31, 2008, 9:00am UTC](https://www.ruby-forum.com/t/helpers-dir-is-missing/152205/1 "2008-10-31T09:00:32Z")

</div>

In my project, I have

class ApplicationController \< ActionController::Base  
helper :all  
end

module ApplicationHelper  
def use\_module  
### ssss  
end  
end

class B \< ApplicationController  
def efd  
call\_private()  
end

private  
def call\_private()  
use\_module()  
end  
end

When I call B::efd(), an error return saying ‘use\_module()’ is  
undefined !!

I was wonderring why ‘helper :all’ in my application.rb is not working  
at all.  
Then I find that this method is depend on ‘HELPERS\_DIR’ variable.  
However, when I type this ‘HELPERS\_DIR’ in console, it shows  
‘uninitialized constant’ error.

Does anyone has the same problem?

---

<div class="post-metadata">

**Author:** ![boblu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b19c9b/32.png) [@boblu](https://www.ruby-forum.com/u/boblu)\
**Post date:** [October 31, 2008, 9:19am UTC](https://www.ruby-forum.com/t/helpers-dir-is-missing/152205/2 "2008-10-31T09:19:52Z")

</div>

On 31 Oct 2008, at 07:59, boblu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> end  
> end  
> end
> 
> When I call B::efd(), an error return saying ‘use\_module()’ is  
> undefined !!

Helper methods are added to views, not controllers

Fred

---

<div class="post-metadata">

**Author:** ![boblu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b19c9b/32.png) [@boblu](https://www.ruby-forum.com/u/boblu)\
**Post date:** [October 31, 2008, 9:29am UTC](https://www.ruby-forum.com/t/helpers-dir-is-missing/152205/3 "2008-10-31T09:29:16Z")

</div>

But sometimes, we need some methods that both used in view and  
controller.  
Where do you suggest to put them in?

On Oct 31, 5:18 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![boblu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b19c9b/32.png) [@boblu](https://www.ruby-forum.com/u/boblu)\
**Post date:** [October 31, 2008, 9:43am UTC](https://www.ruby-forum.com/t/helpers-dir-is-missing/152205/4 "2008-10-31T09:43:20Z")

</div>

On Oct 31, 8:28 am, boblu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> But sometimes, we need some methods that both used in view and  
> controller.  
> Where do you suggest to put them in?

You can make controller methods available to views with helper\_method,  
or you could have a module that you both include in a controller and  
pass to helper (which among other things adds a module to the set of  
helpers a view has).

Fred

---

<div class="post-metadata">

**Author:** ![boblu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b19c9b/32.png) [@boblu](https://www.ruby-forum.com/u/boblu)\
**Post date:** [October 31, 2008, 9:59am UTC](https://www.ruby-forum.com/t/helpers-dir-is-missing/152205/5 "2008-10-31T09:59:45Z")

</div>

ok, I see. Thank you.

I just think that “a module that both include in a controller and a  
helper” is a little bit complicated then just write that method in  
helper and make controller can access it, in the case that the number  
of this kind of methods is not a big one.

Emm, maybe this is not the correct ruby way of doing things.  
And maybe I should re-orgnize my app structure like your suggestion.  
Thank you.

On Oct 31, 5:42 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
