title: I would like to add a tooltip to the glyphicon
body: <pre><code>Rails 4.1
  Bootstrap 3
  </code></pre>
  
  <p>This is the code for the view:</p>
  
  <pre><code>&lt;td&gt;
    &lt;%= link_to my_model, class: 'btn btn-info' do %&gt;
      &lt;span class="glyphicon glyphicon-search"&gt;&lt;/span&gt;
    &lt;% end %&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>I would like to add a tooltip when the mouse hovers over the button to display something like "View Agent Data". I found some help on how to do this with bootstrap, but not when using a glyphcon. Any ideas?</p>
  
  <h1>Solution:</h1>
  
  <p>In the view:</p>
  
  <pre><code>&lt;%= link_to my_model, class: 'btn btn-info',  title: 'View Agent Data', 'data-toggle' =&gt; 'tooltip', 'data-placement' =&gt; 'right' do %&gt;
    &lt;span class="glyphicon glyphicon-search"&gt;&lt;/span&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>In application.js:</p>
  
  <pre><code>$(document).on("ready page:change", function() {
    $('.btn-info').tooltip();
  });
  </code></pre>