# 2 helpers, same method name?

**URL:** <https://www.ruby-forum.com/t/2-helpers-same-method-name/137093>\
**Category:** Rails\
**Created:** [May 8, 2008, 10:23pm UTC](https://www.ruby-forum.com/t/2-helpers-same-method-name/137093 "2008-05-08T22:23:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_j](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@dr\_j](https://www.ruby-forum.com/u/dr_j)\
**Post date:** [May 8, 2008, 10:23pm UTC](https://www.ruby-forum.com/t/2-helpers-same-method-name/137093/1 "2008-05-08T22:23:04Z")

</div>

I have 2 controllers, say, “A”, and “B”. Associated with this, then,  
are 2 views, as well as 2 helpers.

Is it possible to have a helper method in a\_helper.rb and a method of  
the same name in b\_helper.rb?

A little more specifically, I have a helper method to display a chart;  
the helper method really just turns around and invokes a method on the  
controller and does a send\_data to send the image. The implementation  
of the helper methods is a little bit different (given different  
controllers and images), but the intent was the same, so I named the  
helper method the same in both helpers. I would have thought that,  
while the “A” view was being rendered, only the “A” helper was  
available, but the error message I’m getting indicates that the helper  
from “B” is being invoked (I can easily tell because the B helper  
takes a parameter while the A helper does not).

Is it not possible to use the same helper method name in two different  
helpers?

Thanks!

j

---

<div class="post-metadata">

**Author:** ![dr\_j](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/6a8cbe/32.png) [@dr\_j](https://www.ruby-forum.com/u/dr_j)\
**Post date:** [May 8, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/2-helpers-same-method-name/137093/2 "2008-05-08T22:24:50Z")

</div>

On May 8, 9:00 pm, dr\_j [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have 2 controllers, say, “A”, and “B”. Associated with this, then,  
> are 2 views, as well as 2 helpers.
> 
> Is it possible to have a helper method in a\_helper.rb and a method of  
> the same name in b\_helper.rb?

Remove helper :all from application.rb

Fred
