Skip to content

Instantly share code, notes, and snippets.

def tooltip(location, close_button=false, &block)
content = capture(&block)
tooltip_carrot = "<span class=\"icon icon-tooltip-carrot\"></span>".html_safe
close_link = close_button ? "<a class=\"close-tooltip\"><span class=\"icon icon-close-tooltip\"></span></a>".html_safe : ""
content_tag(:span, (content + close_link + tooltip_carrot), :class => "tooltip tooltip-#{location}")
end
// The following should work
// Default no close button