Skip to content

Instantly share code, notes, and snippets.

@trosage
Created December 15, 2011 23:56
Show Gist options
  • Save trosage/1483569 to your computer and use it in GitHub Desktop.
Save trosage/1483569 to your computer and use it in GitHub Desktop.
def tooltip(location, close=false, &block)
content = capture(&block)
if close == true
"<a class=\"close-tooltip\"><span class=\"icon icon-close-tooltip\"></span></a>".html_safe
end
tooltip_carrot = "<a class=\"close-tooltip\"><span class=\"icon icon-close-tooltip\"></span></a><span class=\"icon icon-tooltip-carrot\"></span>".html_safe
content_tag(:span, (content + tooltip_carrot), :class => "tooltip tooltip-#{location}")
end
<% tooltip 'left' do %>
<strong>Customize Treehouse</strong>
<span class="note">Build your own path by limiting the list of topics Treehouse offers to the ones that interest you most.</span>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment