title: Bootstrap tooltip is not working after filtering with ajax in Rails 4
body: <p>I got an index page that shows multiple objects of <code>foo</code> and integrated a filter function with the gem <a href="https://github.com/activerecord-hackery/ransack" rel="nofollow">ransack</a> and this ajax script:</p>
  
  <pre><code>$('#foo_search input').change(function(){
      $.get($('#foos_search').attr('action'), $('#foos_search').serialize(), null, "script");
      return false;
  });
  </code></pre>
  
  <p>This is working just fine at the moment. After that I added a tooltip on each <code>foo</code> shown on the index page with <a href="http://getbootstrap.com/javascript/#tooltips" rel="nofollow">bootstrap</a>. JS-code looks like this:</p>
  
  <pre><code>$('[data-toggle="tooltip"]').tooltip();
  </code></pre>
  
  <p>Index page looks something like this:</p>
  
  <pre><code>//index.html.erb
  &lt;div id="foos"&gt;
    &lt;%= render 'foos' %&gt;
  &lt;/div&gt;
  
  //_foos.html.erb
  &lt;% @foos.each do |f| %&gt;
    &lt;div class="btn btn-default"&gt;
      &lt;span data-toggle="tooltip" data-html="true" data-placement="top" title="&lt;% f.details.each do |d| %&gt;&lt;li&gt;&lt;%= d.name %&gt;&lt;/li&gt;&lt;% end %&gt;"&gt;
        DETAILS
      &lt;/span&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>As you can see each <code>foo</code> got a bunch of <code>details</code> and all details are supposed to show up in the tooltip. That works very well until I use my filter. As soon as I filter the <code>foo</code>s with ransack the JS will stop working and no tooltips will show until I reload the page.</p>
  
  <p>Any ideas on this?</p>
  
  <p>EDIT:
  I uploaded the current version on heroku so maybe you could just have a look there. Since it's in German I will tell you how to get to the problem:
  You will see the <code>foo</code> objects in bright yellow jumbtrons and if you hover over "Geeignet für" for example you will see a tooltip pop up. But as soon as you use the filter function on the left the tooltip wont work anymore and will instead show some html.</p>
  
  <p><a href="https://sheltered-escarpment-6887.herokuapp.com/list" rel="nofollow">https://sheltered-escarpment-6887.herokuapp.com/list</a></p>
  
  <p>EDIT2:
  This is reloading the partial after changing filter options:</p>
  
  <pre><code>//index.js.erb
  $("#foos").html("&lt;%= escape_javascript(render("foos")) %&gt;");
  </code></pre>
  
  <p>EDIT3:
  Thanks so cassioscabral I figured it out:</p>
  
  <pre><code>//index.js.erb
  $("#houses").html("&lt;%= escape_javascript(render("houses")) %&gt;");
  $('[data-toggle="tooltip"]').tooltip();
  </code></pre>