title: has_many through fetching related values
body: <p>What's the best way to extract the related data from a has many through relationship?</p>
  
  <p>If my tasks and categories are joined through categorizations, I'd like to display a list of tasks and their related categories in my index view.</p>
  
  <p>I've tried putting the following in my controller:</p>
  
  <pre><code>@tasks = Task.find(:all, :include =&gt; :taskcategories )
  </code></pre>
  
  <p>However that fails.</p>
  
  <p>In my view, I tried this:</p>
  
  <pre><code>&lt;% for task in @tasks %&gt;
  
  &lt;li&gt;&lt;%= task.title %&gt; &lt;%= task.taskcategory_name %&gt;&lt;/li&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>That also fails.</p>