title: Rails: help refactoring controller
body: <p>I have a controller that I want to refactor. This controller basically renders a formatted XML document.</p>
  
  <p>The controller does 4 main things.</p>
  
  <ol>
  <li>It get records from a DB</li>
  <li>It reads a static xml file from rails_root/config</li>
  <li>It iterates through DB records and gsubs the XML doc using the DB data</li>
  <li>It renders the XML document as :text</li>
  </ol>
  
  <p>My question is:</p>
  
  <p>Where is the correct place for 2/3 to happen within in the Rails framework? It seems to me that they shouldn't be in the controller.</p>
  
  <p>I'm on Rails 2.3</p>
  
  <p>Cheers</p>