title: How to write partial ERB template in Sinatra?
body: <p>How to refactor this code? I write on Sinatra I need to separate into a separate file</p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;div class="col-xs-3"&gt;
      &lt;% @user.posts.each do |post| %&gt;
        &lt;a href="/posts/&lt;%= post.id %&gt;"&gt;&lt;%= post.title %&gt;&lt;/a&gt;&lt;br&gt;
        &lt;p&gt;&lt;%= post.body %&gt;&lt;/p&gt;
        &lt;% unless post.comment.blank? %&gt;
          &lt;% post.comment.each do |comment| %&gt; 
            &lt;p&gt;&lt;%= comment.body %&gt;&lt;/p&gt;
            &lt;% unless comment.comment.blank? %&gt;
              &lt;% comment.comment.each do |comment2| %&gt; 
                &lt;p&gt;&lt;%= comment2.body %&gt;&lt;/p&gt;
                &lt;% unless comment2.comment.blank? %&gt;
                  &lt;% comment2.comment.each do |comment3| %&gt; 
                    &lt;p&gt;&lt;%= comment3.body %&gt;&lt;/p&gt;
                  &lt;% end %&gt; 
                &lt;% end %&gt; 
              &lt;% end %&gt; 
            &lt;% end %&gt;   
          &lt;% end %&gt;   
        &lt;% end %&gt; 
      &lt;% end %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>my model looped comment</p>
  
  <pre><code>def up
      create_table :comments do |t|
        t.string :body
        t.integer :post_id
        t.integer :comment_id
        t.timestamps
      end
    end
  </code></pre>
  
  <p>This is my migration model comment</p>