Reputation:
I'm trying to get an erb link to display some text when a mouse is hovered over it. <a title="hover">text</a>
works on normal text, but I can't get it to work on a link. Here's what I tried, which does nothing:
<a title="hover"> <%= link_to "All", "all/allthings" %> </a>
Am I going to have to resort to using javascript?
Upvotes: 2
Views: 220
Reputation: 5229
Try this:
<%= link_to "All", "all/allthings", title: 'hover' %>
More information on: link_to
Upvotes: 5
Reputation: 29
If you wrap the link in a div tag with the desired title in it you will achieve the result you are looking for!
<div title="hover"><a href="#">link to the place</a></div>
Upvotes: 0