title: Keep Controllers DRY : where to put shared methods?
body: <p>My code is starting to have duplicates.... because I don't know where to put methods/functions that need to be accessed by (2) different controllers, and just to get it up quickly I just duplicated it.  </p>
  
  <p>So I have a users_controller, and a pages_controller and posts_controller.   </p>
  
  <p>On the users page, I have posts being displayed. </p>
  
  <p>On the homepage, I also have posts being displayed.</p>
  
  <p>Where should I put shared/common code so that the users_controller and pages_controller and posts_controller can all have access to ithese methods?   </p>
  
  <p>Right now, I have duplicated def methods in some controllers, and also some duplicate private methods in each controller.  </p>
  
  <hr>
  
  <p>On a related note, how can I access methods defined in one controller from another controller?  </p>