Skip to content

Instantly share code, notes, and snippets.

@abrambailey
Created November 30, 2012 10:23
Show Gist options
  • Save abrambailey/4175004 to your computer and use it in GitHub Desktop.
Save abrambailey/4175004 to your computer and use it in GitHub Desktop.
truncate with full length tooltip
def trunk(input, length, path=nil)
shorten = truncate(input, :length => length)
return link_to shorten, path, :rel=>"tooltip", :title=>input if path
content_tag(:span, shorten, :rel=>"tooltip", :title=>input)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment