hyp*_*jas 2 jquery ruby-on-rails tooltip ruby-on-rails-3 twitter-bootstrap
我在应用上使用http://twitter.github.com/bootstrap/javascript.html#tooltips.
我有这个rails代码:
<%= link_to t('.shipping_details'), "#", :rel => "tooltip", :title => "#{render 'orders/partials/shipping_cost_detail', :o => o}" %>
Run Code Online (Sandbox Code Playgroud)
问题是,我无法呈现HTML代码的内部_shipping_cost_detail.html.erb
例如,如果我在工具提示中添加<div></div>或<br>显示类似文本.
如何在工具提示中渲染html?
初始化工具提示时,有一个html属性,指定是插入文本还是html.默认情况下,这是false- 您需要将其设置为true.
像这样的东西:
$('.shipping_details').tooltip({
html: true,
// other options...
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1801 次 |
| 最近记录: |