Am trying to get qtip2 working with a rails3 application.
qtip’s working great but I can’t figure out how to get it to work with dynamic content from my models. Am stuck formatting my js…
In my view, I’m trying the following:
<li><%= link_to milestone.name, order_path(milestone.order_id), { 'data-href' => :name, :class => 'selector' } %> </li>
(I’ve only put :name in there to test)
This renders as html:
<li><a href="/orders/1" class="selector" data-href="name">Setup Equipment</a> </li>
Which looks ok.
In my application.js, I have this:
$('.selector').qtip({
content: $(this).attr('data-href')
});
I think I have something wrong with my content syntax. I can see the tooltip if I replace with:
$('.selector').qtip({
content: 'test'
});
Any help appreciated
I think you should do :
fiddle here http://jsfiddle.net/cnkJU/2/