title: rendering a html.erb in rails with javascript
body: <p>I create a page and some parts of it are layout files that are rendered. However I want to render one of these rendered part again with javascript code.</p>
  
  <p>I want to render these part again</p>
  
  <pre><code>&lt;div id="dialog" title="Bookmark Folders" style="resize: both;"&gt;
          &lt;%=render "layouts/filetree.html.erb"%&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It render function creates this:</p>
  
  <pre><code>&lt;div id="accordion"&gt;
      &lt;% @user.folders.each do |f| %&gt; &lt;h3 id="&lt;%= f.folder_name%&gt;" class="folderBar"&gt;&lt;a href="#" class="folderName"&gt;&lt;b id="folderName"&gt;&lt;%= f.folder_name%&gt;&lt;/b&gt; created &lt;%=distance_of_time_in_words(f.created_at, Time.now)%&gt; before&lt;/a&gt;&lt;/h3&gt;
      &lt;div class="&lt;%= f.folder_name.delete(" ")%&gt;"&gt;
          &lt;%if f.docs.empty?%&gt;
          &lt;b&gt;-No document currently!-&lt;/b&gt;
          &lt;%else%&gt;
          &lt;% f.docs.each do |r|%&gt;
          &lt;a href="&lt;%=r.url%&gt;" style = "color:#0066CC;"&gt;&lt;%= r.title%&gt;&lt;/a&gt;&lt;br/&gt;
          &lt;b&gt;&lt;%=r.url%&gt;&lt;/b&gt;&lt;br /&gt; 
          &lt;%= r.snippet%&gt;&lt;hr/&gt;
          &lt;%end%&gt;
          &lt;%end%&gt;
      &lt;/div&gt;
      &lt;%end%&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Because after some execution there are some changes over "folders", I want to render this part again to see the update.</p>