title: Is it faster to render a form for each of ~100 records or load individual forms with ajax?
body: <p>I have a Comment model, which has_many Replies. I'm going to have about 100 comments on any given page, and each comment should have the option to write a reply to it. This requires that each comment somehow have its own Reply form.</p>
  
  <p>Which of the following methods would be easier on my server?</p>
  
  <p><strong>1.)</strong> Load one form per Comment upon page load, and immediately hide each with javascript. Each Comment also has a button which when clicked causes the form to show. The form hides again when the user clicks anywhere else.</p>
  
  <p><strong>2.)</strong> Each Comment starts out with a button and an empty div. When the user clicks said button, the empty div is filled with the form via ajax. When the user clicks anywhere else, the div is once again emptied.</p>
  
  <p>The form I'm talking about is very simple. It would be something like this: </p>
  
  <pre><code>  &lt;%= form_for([@comment, @reply], remote: true ) do |f| %&gt;
      &lt;%= f.text_area :text %&gt;
      &lt;%= f.submit "Post" %&gt;
    &lt;% end %&gt;
  </code></pre>
  
  <p>Any input would be much appreciated.</p>