1

I want to create a tooltip with red colour font for link_to in rails. Ex: The below code i used for link_to

<%= link_to "javascript:void(0)", 'data-toggle': 'tooltip', title:"Click to delete \n <span style='color:red;'>Warning:- You will not be able to use </span>",onclick: "delete",style: "color:blue;",class: "custom_tooltp" %>

Issue : I'm not getting warning text in red colour.

Thanks in advance.

Sampat Badhe
  • 8,710
  • 7
  • 33
  • 49
rajesh raj
  • 23
  • 3
  • welcome to Stackoverflow. You may find [link] https://stackoverflow.com/help/how-to-ask helpful in framing your question. Can you go into your browsers developer tools and see exactly what code is being generated, Is there anything else you have tried and what is the result? – A Haworth Oct 02 '20 at 07:12
  • Have a look at this : https://stackoverflow.com/questions/17642447/change-bootstrap-tooltip-color – Luskmo Oct 02 '20 at 08:39

2 Answers2

0

To create a red link in HTML:

<a href="https://blog.corsego.com/" style="color:#FF0000;">Red Link</a>

With a ruby link_to:

= link_to "Blog", "https://blog.corsego.com", target: :_blank, style: "color:#FF0000;"
Yshmarov
  • 3,450
  • 1
  • 22
  • 41
0

Post some research i found solution and worked for me.

css : .red-tooltip + .tooltip > .tooltip-inner {background-color: #ffffff; color:#000000;} js : $('[data-toggle="tooltip"]').tooltip();

<%= link_to "javascript:void(0)", 'data-toggle': 'tooltip','data-html': 'true', 'data-placement': 'left', title:"Click to delete
Warning:- You will not be able to use ",onclick: "delete",style: "color:blue;",class: "red-tooltip" %>

rajesh raj
  • 23
  • 3