# Are all helpers accessible to all controllers?

**URL:** <https://www.ruby-forum.com/t/are-all-helpers-accessible-to-all-controllers/134321>\
**Category:** Rails\
**Created:** [April 9, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/are-all-helpers-accessible-to-all-controllers/134321 "2008-04-09T20:40:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug316](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/858c86/32.png) [@doug316](https://www.ruby-forum.com/u/doug316)\
**Post date:** [April 9, 2008, 8:40pm UTC](https://www.ruby-forum.com/t/are-all-helpers-accessible-to-all-controllers/134321/1 "2008-04-09T20:40:52Z")

</div>

In my app I have model helpers with the same names, such that each  
controller should be calling the correct helper within its own  
helper’s namespace. Isn’t this the expected behavior?

It appears that when I call a helper it’s picking the module that is  
alphabetically last which is for a different model/controller  
alltogether.

I’m using Rails 2.0.2.

---

<div class="post-metadata">

**Author:** ![doug316](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/858c86/32.png) [@doug316](https://www.ruby-forum.com/u/doug316)\
**Post date:** [April 9, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/are-all-helpers-accessible-to-all-controllers/134321/2 "2008-04-09T20:58:24Z")

</div>

doug316 wrote:

> In my app I have model helpers with the same names, such that each  
> controller should be calling the correct helper within its own  
> helper’s namespace. Isn’t this the expected behavior?
> 
> It appears that when I call a helper it’s picking the module that is  
> alphabetically last which is for a different model/controller  
> alltogether.
> 
> I’m using Rails 2.0.2.

This is what is at the top of application\_controller.rb by default:

class ApplicationController \< ActionController::Base  
helper :all # include all helpers, all the time

So, all files in the load path with the glob form \*\_helper.rb are  
automatically loaded in Rails 2.0

---

<div class="post-metadata">

**Author:** ![doug316](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/858c86/32.png) [@doug316](https://www.ruby-forum.com/u/doug316)\
**Post date:** [April 9, 2008, 9:53pm UTC](https://www.ruby-forum.com/t/are-all-helpers-accessible-to-all-controllers/134321/3 "2008-04-09T21:53:29Z")

</div>

Thanks!!

On Apr 9, 11:58 am, James B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
