title: include data from one table to attachment in Rails
body: <p>I need show avatar from user in posts list, in "show" avatar work.</p>
  
  <p>Controller</p>
  
  <pre><code>def index
    @posts = Post.all
    @user = User.find(@post.user_id)
  end
  </code></pre>
  
  <p>View
  index.html.haml</p>
  
  <pre><code>= render @posts
  </code></pre>
  
  <p>_post.html.haml</p>
  
  <pre><code>= @user.avatar.url(:thumb)
  = post.title
  = post.body
  </code></pre>