title: How to organize helper code in Rails?
body: <p>How do you organize the different types of helper code in Rails? Or, more generally speaking, am I supposed to have only view helpers outside the main files for a particular model/view/controller?</p>
  
  <p>Here's what I mean: I have joined a team working on a large Rails app. As far as I can see, all the files in <code>app/helpers</code> are view helpers, that can be included in controllers and mailers via <code>add_template_helper(HelperName)</code> or <code>helper :helper_name</code>.</p>
  
  <p>But imagine this situation - you want to split a large mailer into several smaller mailers. In the large mailer you have defined several helper methods. Now you want to access these helper methods also in the new mailers. </p>
  
  <p>How do you go about it? </p>
  
  <p>Should you create a new module/file, put it under <code>app/helpers</code> and then use it via <code>include HelperName</code> or is there another convention for this? </p>
  
  <p>I have not stumbled upon this yet, but I imagine there might be some model helpers as well, that I want shared between several models, so I would like to know how to organize them as well.</p>
  
  <p><strong>Edit:</strong> After some reading I realized that just including a method in a controller or a mailer introduces the problem that this method becomes a controller/mailer action. So I guess this is also a more general Ruby question - how do I share methods between several classes, while keeping this methods private. If class A, B, and C must have method foo, do I declare it three times as a private method within the class definitions of A, B and C or can I define it in a module, include the module in the classes A, B, and C, but then again keep it private?</p>