I'm using method: :delete
on a link in rails, and trying to get a bootstrap tooltip on it.
This doesn't show a tooltip:
=link_to "destroy", blog_path(blog), "data-original-title" => "Delete your answer", "data-placement" => "top", :rel => "tooltip", method: :delete
However, if I remove the method: :delete
, the tooltip works.
How can I get a tooltip on a delete link?
This is a JQuery selector problem.
If you use something like:
$('a[rel="tooltip"]').tooltip();
You're telling the JQuery selector to take the only the elements with rel attribute with only "tooltip" value.
So I believe what you're looking for is this piece of code.
$('a[rel~="tooltip"]').tooltip();
So, now JQuery will take all the elements that has the "tooltip" word inside the rel attribute.
More information below.
http://api.jquery.com/attribute-contains-word-selector/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With