我想显示带有富文本的工具提示,如下所示
<%= link_to 'test', '#', :title => "<b>sample</b>".html_safe %>
它无效并显示html标签。
想在锚标题属性中显示没有html标签的html格式文本。
请分享您的想法。
答案 0 :(得分:0)
最后通过使用Jquery-ui工具提示
实现如下`
<%= link_to 'test', '#', :title => "<b>sample</b>", :id => "demo_box" %>`
$(function(){
$('#demo_box').tooltip({
content: function(){
var element = $( this );
return element.attr('title')
}
});
});
`