title: Getting names of all children in has_many, :through
body: <p>I've got this bit of code which returns an array of IDs like <code>[1, 2, 3]</code>:</p>
  
  <pre><code>&lt;% @articles.each do |a| %&gt;
    &lt;%= a.brand_ids %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p><code>Article</code> and <code>Brand</code> have a <code>has_many, :through</code> relationship. How would I return a list of the names of each brand instead of IDs? <code>a.brands.name</code> returns <code>Brand</code>. Any thoughts?</p>