# Organizing Helpers

**URL:** <https://www.ruby-forum.com/t/organizing-helpers/175319>\
**Category:** Rails\
**Created:** [September 11, 2009, 5:55am UTC](https://www.ruby-forum.com/t/organizing-helpers/175319 "2009-09-11T05:55:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diabolist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Post date:** [September 11, 2009, 5:55am UTC](https://www.ruby-forum.com/t/organizing-helpers/175319/1 "2009-09-11T05:55:37Z")

</div>

I am trying to keep my code organized as a project grows larger. I am  
having trouble organizing helpers into a way that I like. Right now,  
I have helpers named after the controllers and one application  
helper. I am trying not to duplicate any code, so when two controller  
views need the same helper method, I move it into the  
application\_helper.rb file. As the project is growing, the  
application\_helper.rb file is becoming a bit clunky with methods that  
apply to more than one controller’s view, but that are certainly not  
application-wide. Any ideas of good organization to keep helper  
methods that span only a few controller’s views tidy?

Thanks,

Andrew

---

<div class="post-metadata">

**Author:** ![diabolist](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@diabolist](https://www.ruby-forum.com/u/diabolist)\
**Post date:** [September 11, 2009, 1:32pm UTC](https://www.ruby-forum.com/t/organizing-helpers/175319/2 "2009-09-11T13:32:14Z")

</div>

On Sep 10, 2009, at 11:53 PM, Andrew P. wrote:

> Thanks,
> 
> Andrew

Just put the common code into its own helper and put the:  
include MyCommonHelper  
into both (all) the controllers that need it. Name it something that  
describes the feature that it helps (and the …Helper suffix will  
clue you into where to find it).

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
