Using hints with link_to (Ruby on Rails 3.2.3)

I managed to create a tooltip for the text using code similar to:

<a href="#" rel="tooltip" title="something">text on page</a> 

However, I would like to make a tooltip for the link defined in the menu using the link_to command. I included an instruction for which I need a hint:

 <li><i class="icon-edit"></i>&nbsp;<%= link_to current_user.first_name+' '+current_user.last_name, edit_user_path(current_user) %></li> 

Here is the JS code in bootstrap.js.coffee:

 $(".tooltip").tooltip() $("a[rel=tooltip]").tooltip() 

I'm a student still learning a lot about Rails, Twitter Bootstrap, CSS3, HTML5, etc. I did a lot of searches on the Internet, but did not find examples of this that I understood. Basically there is nothing that directly says that I can make a tooltip in the link_to statement that worked.

Any help would be appreciated.

+7
source share
1 answer

Thus:

 link_to 'Text', '/link', title: 'some title', rel: 'tooltip' 

update:

This is the syntax of ruby ​​1.9. For 1.8 it will be

 link_to 'Text', '/link', :title => 'some title', :rel => 'tooltip' 
+23
source

All Articles