title: link_to anchor for JS Table of Contents
body: <p>I have a show view with </p>
  
  <pre><code>&lt;div&gt;&lt;%= simple_format @chapter.body, id: "toc-container" %&gt;&lt;/div&gt;
  </code></pre>
  
  <p>with some JS</p>
  
  <pre><code>&lt;script&gt; 
    $headings = $("h2, h3");
    $.each($headings, function(index, value){
      $("#toc-container").append("&lt;li&gt;" + $(value).html() + "&lt;/li&gt;");
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>The code creates the list for h2 and h3 headers, above the chapter.body.</p>
  
  <p>How does one make the list link_to anchor for each header? </p>