Created
November 30, 2012 10:20
-
-
Save abrambailey/4174971 to your computer and use it in GitHub Desktop.
truncate with full length tooltip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def trunk(input, length, *path) | |
shorten = truncate(input, :length => length) | |
if path.empty? | |
return content_tag(:span, shorten, :rel=>"tooltip", :title=>input) | |
else | |
return link_to shorten, path[0], :rel=>"tooltip", :title=>input | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment