title: Why is ruby returning array type instead of attribute
body: <p>I have this code in my view</p>
  
  <pre><code>&lt;% @items.each do |i| %&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;%= i.name %&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>and this code in my controller</p>
  
  <pre><code>  @categories = Category.find_by_sql("SELECT * FROM categories WHERE users_id =#{session[:user_id]}")
    @categories.each do |c|
      @items &lt;&lt; (Item.where(:categorys_id =&gt; c.id))
    end
  </code></pre>
  
  <p>and when I run it, the code generates a page looking like this:
  "Your username is a Item Item Item"
  instead of 
  "Your username is a Digital Fortress Oceans Eleven Settlers"</p>