2

I'm using http://twitter.github.com/bootstrap/javascript.html#tooltips on a app.

I have this rails code:

<%= link_to t('.shipping_details'), "#", :rel => "tooltip",  :title => "#{render 'orders/partials/shipping_cost_detail', :o => o}"  %>

The problem is that I can't render html code inside of _shipping_cost_detail.html.erb

For example If I add a <div></div> or <br> is visible like text on tooltip.

How can I render html inside of tooltip?

2 Answers 2

5

When you are initialising the tooltip there is a html property, which specifies whether you are inserting text or html. By default this is false - you need to set it to true.

Something like this:

$('.shipping_details').tooltip({
     html: true,
     // other options...
});
Sign up to request clarification or add additional context in comments.

Comments

1

Use html_safe option, I think it will solve ur problem

<%= link_to t('.shipping_details'), "#", :rel => "tooltip",  :title => "#{render 'orders/partials/shipping_cost_detail', :o => o}".html_safe  %>

1 Comment

I have checked this option but is incorrect and is not working fine for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.